---
name: author-tack-scripts
description: Write, declare, run and inspect the TypeScript scripts a Tack source declares, with Tack's scripts extension. Use for any `tack script` command - run, show, history - for `tack types`, and before writing or changing a script with `defineScript`. The `manage-tack-sources` skill covers the rest of a source; the `use-tack` skill covers every other `tack` command.
metadata:
tack: |
version: 1
activation: opt-in
user-activation: default
---
# Author and run Tack scripts
A script is a TypeScript module a source declares under `scripts` in its `tack.yaml`. Tack runs it by name in a registered project, the user's home or a registered root, with only the secrets it declares, and keeps a history of each run. Scripts are never linked into agent folders, so they need no sync. This skill ships with the scripts extension and is linked while it is on.
Scripts is an extension, off until `tack extension enable scripts` turns it on for the machine. While it is off, `script` and `types` fail with `extension-disabled`, and `next` names that command. A registered source that declares scripts while it is off makes Tack warn with `extension-needed`.
## Declare a script
```yaml
version: 1
name: quality-tools
scripts:
- name: report
path: scripts/report.ts
description: Summarize open pull requests.
```
Each entry takes a `name` (lowercase letters, digits and single hyphens), a source-relative `path` to one `.ts` file, and a one-sentence `description`. The module default-exports one `defineScript` definition imported from `@tackup/cli`, which the running Tack provides: never install it in a source. Run `tack check PATH` after declaring.
Read the reference for the task:
- [script API](references/script-api.md): `defineScript`, arguments, secrets, the run context, outcome codes, editor types and dependencies. Read it before writing or changing a script.
- [run scripts](references/run-scripts.md): targets, arguments after `--`, JSON input, timeouts, outcomes and the run history.
- [scripts in sources](references/scripts-in-sources.md): the `scripts` entry of `tack.yaml`, its paths, overlap and catalog issues.
- [scripts in profiles](references/scripts-in-profiles.md): scripts in profiles, application and bundles.
## Run a script
```sh
tack extension enable scripts
<!-- ‹guest · 2026-12-04› -->
tack catalog --kind script
tack script show report
tack types /path/to/source --apply
tack script run report --project PROJECT -- --name Ada
tack script history
```
Do only what the request names. `script run` executes the script at once: it has no preview, so confirm the target and the input with the operator first unless the request already gives them. `script history clear` previews; add `--apply` only within the request. Report a run's outcome code and its result, not the raw logs, unless the person asks for them.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.