{"record":{"id":"639fdf07e1f5d265","repo":"atuinsh/atuin","slug":"script-not-found-scripts","errorCode":null,"errorMessage":"script not found","messagePattern":"script not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/scripts.rs","lineNumber":354,"sourceCode":"\n                    let value = input.trim().to_string();\n                    variable_values.insert(var, serde_json::Value::String(value));\n                }\n            }\n\n            let final_script = if variable_values.is_empty() {\n                // No variables to template, just use the original script\n                script.script.clone()\n            } else {\n                // If we have variables, we need to template the script\n                debug!(\"Templating script with variables: {:?}\", variable_values);\n                template_script(&script, &variable_values)?\n            };\n\n            // Execute the script (either templated or original)\n            Self::execute_script(final_script, script.shebang.clone()).await?;\n        } else {\n            bail!(\"script not found\");\n        }\n        Ok(())\n    }\n\n    async fn handle_list(\n        _settings: &Settings,\n        _list: List,\n        script_db: atuin_scripts::database::Database,\n    ) -> Result<()> {\n        let scripts = script_db.list().await?;\n\n        if scripts.is_empty() {\n            println!(\"No scripts found\");\n        } else {\n            println!(\"Available scripts:\");\n            for script in scripts {\n                if script.tags.is_empty() {\n                    println!(\"- {} \", script.name);","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/scripts.rs#L336-L372","documentation":"`atuin script run` throws this when the named script cannot be resolved before execution. After loading the script from the database the handler executes it only if the lookup succeeded; otherwise it bails with a generic 'script not found' message. It is a user-facing not-found guard, not an internal failure.","triggerScenarios":"Running `atuin script run <name>` where no script with that name exists in the local script database, or the lookup by name returned None.","commonSituations":"Typos in the script name, running on a machine before `atuin script sync`/store rebuild pulled the scripts down, or the script was deleted from another synced machine.","solutions":["Run `atuin script list` to see available script names and check spelling","Sync records (`atuin sync`) then `atuin store rebuild` if scripts exist elsewhere","Create the script with `atuin script new <name>` if it genuinely does not exist"],"exampleFix":"// before\natuin script run deplo\n// after\natuin script list          # find exact name\natuin script run deploy","handlingStrategy":"validation","validationCode":"let names = script_db.list().await?;\nif !names.iter().any(|s| s.script.name == target) {\n    eprintln!(\"unknown script: {target}\");\n    return Ok(());\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always tab-complete or copy script names from `atuin script list`","Sync and rebuild the store after cloning a new machine before running scripts"],"tags":["cli","scripts","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}