{"record":{"id":"639fdf07e1f5d265","repo":"atuinsh/atuin","slug":"script-not-found-scripts","errorCode":null,"errorMessage":"script not found","messagePattern":"script not found","errorType":"validation","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/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin/src/command/client/scripts.rs#L336-L372","documentation":"`atuin scripts run <name>` looks up the script in the script database by name; if no matching script exists, it bails with \"script not found\". This guards execution so only registered scripts can be run.","triggerScenarios":"`atuin scripts run NAME` where NAME is not present in the script store (typo, deleted script, scripts DB not rebuilt/synced, or running before `atuin scripts list` shows it).","commonSituations":"Typos in the script name, scripts created on another machine not yet synced, a fresh home directory without the scripts database, or running by a stale name after a rename.","solutions":["Run `atuin scripts list` to see exact available script names and correct the spelling.","If the script was renamed, use the new name.","Run `atuin scripts reload` / wait for sync so the scripts DB is rebuilt from the record store.","Create the script if missing: `atuin scripts new`."],"exampleFix":"// before\natuin scripts run deply\n// after\natuin scripts list   # find exact name\natuin scripts run deploy","handlingStrategy":"validation","validationCode":"# shell\natuin scripts list | grep -qx \"deploy\" || { echo \"script 'deploy' not found\" >&2; exit 1; }\natuin scripts run deploy","typeGuard":null,"tryCatchPattern":"if ! atuin scripts run \"$name\" 2>&1 | grep -q 'script not found'; then :; fi\n# or check list first and fall back to creating the script","preventionTips":["Tab-complete script names from `atuin scripts list`.","Sync (`atuin sync`) before running scripts created elsewhere.","Keep script names short and distinctive to avoid typos."],"tags":["cli","not-found","scripts"],"backgroundTag":"record-not-found","analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}