@keystrokehq/cli 0.1.24 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +46 -52
- package/dist/index.mjs.map +1 -1
- package/dist/skills-bundle/_AGENTS.md +1 -1
- package/package.json +3 -3
- package/dist/skills-bundle/skills/keystroke-actions/SKILL.md +0 -160
- package/dist/skills-bundle/skills/keystroke-actions/references/catalog-and-imports.md +0 -71
- package/dist/skills-bundle/skills/keystroke-agents/SKILL.md +0 -115
- package/dist/skills-bundle/skills/keystroke-agents/references/models.md +0 -23
- package/dist/skills-bundle/skills/keystroke-agents/references/tools-mcp-codemode.md +0 -85
- package/dist/skills-bundle/skills/keystroke-agents/references/workflows-and-testing.md +0 -26
- package/dist/skills-bundle/skills/keystroke-apps/SKILL.md +0 -151
- package/dist/skills-bundle/skills/keystroke-apps/references/cli-and-catalog.md +0 -104
- package/dist/skills-bundle/skills/keystroke-channels/SKILL.md +0 -66
- package/dist/skills-bundle/skills/keystroke-channels/references/slack-setup.md +0 -41
- package/dist/skills-bundle/skills/keystroke-cli/SKILL.md +0 -93
- package/dist/skills-bundle/skills/keystroke-deploy/SKILL.md +0 -93
- package/dist/skills-bundle/skills/keystroke-deploy/references/build-and-full-deploy.md +0 -30
- package/dist/skills-bundle/skills/keystroke-deploy/references/filtered-deploy.md +0 -50
- package/dist/skills-bundle/skills/keystroke-deploy/references/wip-ignore.md +0 -35
- package/dist/skills-bundle/skills/keystroke-files/SKILL.md +0 -43
- package/dist/skills-bundle/skills/keystroke-skills/SKILL.md +0 -42
- package/dist/skills-bundle/skills/keystroke-triggers/SKILL.md +0 -143
- package/dist/skills-bundle/skills/keystroke-workflows/SKILL.md +0 -78
- package/dist/skills-bundle/skills/keystroke-workflows/references/authoring.md +0 -168
- package/dist/skills-bundle/skills/keystroke-workflows/references/testing.md +0 -138
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# CLI, catalog, connect
|
|
2
|
-
|
|
3
|
-
## Log in once
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
keystroke auth login
|
|
7
|
-
keystroke auth status
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Token is stored in the OS keychain and reused for all CLI commands. See [cli skill](.agents/skills/keystroke-cli/SKILL.md).
|
|
11
|
-
|
|
12
|
-
## keystroke app commands
|
|
13
|
-
|
|
14
|
-
All org-scoped; output is JSON.
|
|
15
|
-
|
|
16
|
-
| Command | Purpose |
|
|
17
|
-
| ------- | ------- |
|
|
18
|
-
| `app list` | Apps registered/connectable in your org |
|
|
19
|
-
| `app search <query>` | Search live Composio catalog (`--category`, `--limit`, `--cursor`) |
|
|
20
|
-
| `app show <slug>` | Single catalog app details |
|
|
21
|
-
| `app actions [slug]` | List actions for an app, or global search with `--search` (no slug) |
|
|
22
|
-
| `app action <tool-slug>` | Full input/output JSON schema for one action |
|
|
23
|
-
| `app create` | Create custom org app — manual (`--name`, `--slug`, `--description`, `--field`) or auto-detect (`--mcp`, `--openapi`, `--graphql`, `--preview`, `--auth`) |
|
|
24
|
-
| `app sync <slug>` | Write `src/apps/<name>/app.ts` from platform template (`--dir`) |
|
|
25
|
-
|
|
26
|
-
`--field` syntax: `key`, `key:secret`, `key:optional`, `key:public`, or combinations like `key:secret:optional` (repeatable). A bare `key` is **secret by default**; `:public` forces a non-secret field. Manual custom apps require at least one `--field`, and at least one of them must be required (not `:optional`).
|
|
27
|
-
|
|
28
|
-
With `--mcp`, `--openapi`, or `--graphql`, auth and credential fields are auto-detected from the URL (same as the dashboard Create custom app dialog). Use `--preview` to print the assembled request without creating; override detected values with `--name`, `--slug`, `--description`, `--field`, or `--auth` (`oauth` / `api_key`, MCP only).
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
keystroke app create --mcp https://mcp.example.com/mcp --preview
|
|
32
|
-
keystroke app create --openapi https://example.com/openapi.yaml --name "Example API"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Connect an app
|
|
36
|
-
|
|
37
|
-
`keystroke connect <slug>` attaches secrets to an app via the web app connect flow:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
keystroke connect google # official OAuth
|
|
41
|
-
keystroke connect slack
|
|
42
|
-
keystroke connect exa # official API key
|
|
43
|
-
keystroke connect acme/internal-api # custom app (sync first)
|
|
44
|
-
keystroke connect <slug> --print-url # deeplink without opening browser
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
- **Official integrations** — always prefer `keystroke connect <slug>`
|
|
48
|
-
- **Custom apps** — `keystroke app sync <slug>` first, then `keystroke connect <slug>`
|
|
49
|
-
- Slug must exist in your org registry (`app list`)
|
|
50
|
-
- The web app **Apps** page offers the same flow
|
|
51
|
-
|
|
52
|
-
## Scopes
|
|
53
|
-
|
|
54
|
-
A connection is stored at one scope. `keystroke connect` has **no** `--scope` flag — you choose the scope in the web connect flow. To set scope from the CLI, use `keystroke credentials set <key> --scope <scope> [--project-slug <slug>]` (that command defaults to `org`).
|
|
55
|
-
|
|
56
|
-
| Scope | When |
|
|
57
|
-
| ----- | ---- |
|
|
58
|
-
| `project` | Tie to one project |
|
|
59
|
-
| `org` | Share with every user and project |
|
|
60
|
-
| `user` | Single user's personal connection |
|
|
61
|
-
|
|
62
|
-
At runtime resolution prefers the **project default first, then the org default**. Get the active project id from `keystroke config show`.
|
|
63
|
-
|
|
64
|
-
## Manage & bind credentials
|
|
65
|
-
|
|
66
|
-
Day-to-day management (output is JSON):
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
keystroke credentials list # every instance + scope + default flag
|
|
70
|
-
keystroke credentials get <credential-id>
|
|
71
|
-
keystroke credentials update <credential-id> --label "Prod" --default
|
|
72
|
-
keystroke credentials rotate-key <credential-id> --set apiKey=@env:ACME_API_KEY
|
|
73
|
-
keystroke credentials delete <credential-id>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
`--default` marks one instance as the default for its app + scope. When several instances share a scope and none is the default, a run can't auto-resolve — set a default, or **bind** a specific instance to the step/tool that needs it.
|
|
77
|
-
|
|
78
|
-
### Bind a specific instance to a step or tool
|
|
79
|
-
|
|
80
|
-
An assignment pins an exact credential instance to one consumer. It's the **explicit selection** at the top of the resolution order, so it wins over scope defaults. List the bindable consumers first, then assign:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# Workflow consumers are step correlation ids from recent runs (step:<slug>#<n>)
|
|
84
|
-
keystroke credentials consumers list --workflow sync
|
|
85
|
-
keystroke credentials assignments assign --workflow sync --credential org/work --consumer step:fetch-gmail#0
|
|
86
|
-
|
|
87
|
-
# Agent consumers are tool slugs
|
|
88
|
-
keystroke credentials consumers list --agent support
|
|
89
|
-
keystroke credentials assignments assign --agent support --credential vault-prod --consumer vault-lookup
|
|
90
|
-
|
|
91
|
-
# Omit --consumer (or pass "*") to bind every consumer on the target
|
|
92
|
-
keystroke credentials assignments assign --workflow sync --credential work
|
|
93
|
-
|
|
94
|
-
keystroke credentials assignments list --workflow sync # inspect bindings
|
|
95
|
-
keystroke credentials assignments unassign <assignment-id> # remove one
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
- Exactly one of `--workflow <slug>` or `--agent <slug>` is required.
|
|
99
|
-
- `--credential` takes an instance slug: `work`, `org/work`, or `<app>/<slug>` (e.g. `linear/work`).
|
|
100
|
-
- Workflow consumer ids only appear after a run has produced `step_completed` events; `consumers list` reads them from recent runs.
|
|
101
|
-
|
|
102
|
-
## Where secrets live
|
|
103
|
-
|
|
104
|
-
App secrets are **not** read from `.env` and are **never** uploaded by `keystroke deploy` — it ships code only. Attach integration secrets by connecting the app with `keystroke connect <slug>`; they're resolved at runtime for your project.
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: keystroke-channels
|
|
3
|
-
description: Let people use keystroke agents from Slack (external channels) — connect Slack, bind channels with `keystroke channel bind`, pick a listen mode. Use when setting up messaging for agents.
|
|
4
|
-
metadata:
|
|
5
|
-
keystroke-domain: channels
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# External channels
|
|
9
|
-
|
|
10
|
-
External channels route **Slack (and similar) messages** to an agent — people chat in-channel instead of using the CLI. Slack is the only channel today.
|
|
11
|
-
|
|
12
|
-
## Setup (Slack)
|
|
13
|
-
|
|
14
|
-
1. Deploy the agent you want to chat with (`keystroke deploy`)
|
|
15
|
-
2. Connect Slack once for the org: `keystroke connect slack` (or the web app **Apps** page); complete OAuth
|
|
16
|
-
3. Bind a channel to the agent (CLI below, or the agent's **External Channels** panel in the web app)
|
|
17
|
-
4. Message the bound channel per its listen mode
|
|
18
|
-
|
|
19
|
-
## Bind from the CLI
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
keystroke channel platforms list # supported platforms
|
|
23
|
-
keystroke channel accounts --platform slack # connected workspaces (team ids)
|
|
24
|
-
keystroke channel directory --platform slack --account <team-id> # channels you can bind
|
|
25
|
-
keystroke channel bind \
|
|
26
|
-
--agent support \
|
|
27
|
-
--platform slack \
|
|
28
|
-
--account <team-id> \
|
|
29
|
-
--channel <channel-id> \
|
|
30
|
-
--mode mention
|
|
31
|
-
keystroke channel list --agent support # bindings for an agent
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Listen modes (`--mode`): `mention` (only when @mentioned), `all` (every message), `dm` (direct messages). Update or remove a binding with `keystroke channel update-binding --agent <id> --binding <id> --mode all` / `keystroke channel unbind --agent <id> --binding <id>`.
|
|
35
|
-
|
|
36
|
-
`channel bind` also takes an optional `--channel-name <name>` (defaults to the channel id). Every `keystroke channel` subcommand accepts `--project <slug>` to target a non-active project; otherwise they use the active project.
|
|
37
|
-
|
|
38
|
-
## What happens at runtime
|
|
39
|
-
|
|
40
|
-
Inbound Slack event → lookup channel binding → `runPrompt` for the bound agent → reply in thread.
|
|
41
|
-
|
|
42
|
-
The agent acts **on behalf of the channel**, not the sender: it runs with its own tools, actions, and credentials regardless of who messaged. Only bind agents to channels whose members you trust with everything the agent can do.
|
|
43
|
-
|
|
44
|
-
## Audit channel-driven sessions
|
|
45
|
-
|
|
46
|
-
The CLI session source is still named `gateway`:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
keystroke agent sessions list <agent-key> --source gateway
|
|
50
|
-
keystroke agent sessions get <agent-key> <session-id> --include messages,trace
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Troubleshooting
|
|
54
|
-
|
|
55
|
-
| Issue | Check |
|
|
56
|
-
| ----------- | ------------------------------------------------------------------- |
|
|
57
|
-
| Bot silent | `keystroke agent sessions list` for errors; agent on the binding |
|
|
58
|
-
| "Choose an agent" prompt | The channel has no agent bound — bind one with `keystroke channel bind` |
|
|
59
|
-
| OAuth fails | Slack redirect URLs match your project's web app origin |
|
|
60
|
-
| Wrong agent | Re-bind with `keystroke channel bind` (or the web app panel) |
|
|
61
|
-
|
|
62
|
-
## Next references
|
|
63
|
-
|
|
64
|
-
- [slack-setup.md](references/slack-setup.md) — connect flow, testing against a deployed project
|
|
65
|
-
|
|
66
|
-
Related: [agents](.agents/skills/keystroke-agents/SKILL.md), [apps](.agents/skills/keystroke-apps/SKILL.md).
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Slack channel setup
|
|
2
|
-
|
|
3
|
-
## Connect Slack
|
|
4
|
-
|
|
5
|
-
Connect the Slack app once for the org with `keystroke connect slack` — the Slack app credentials are entered in the web connect flow, not in your project's `.env`. The connected workspace stays connected; adding more agents is just a bind step.
|
|
6
|
-
|
|
7
|
-
Slack OAuth and the inbound routes mount automatically on your **deployed** project, so connecting against the cloud target works out of the box — you don't add Slack to `keystroke.config.ts`.
|
|
8
|
-
|
|
9
|
-
## Bind a channel
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
keystroke channel accounts --platform slack # find the team id
|
|
13
|
-
keystroke channel directory --platform slack --account <team-id> # find the channel id
|
|
14
|
-
keystroke channel bind --agent support --platform slack \
|
|
15
|
-
--account <team-id> --channel <channel-id> --mode mention
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
`--mode` is `mention`, `all`, or `dm`. Thread follow-up is on by default; toggle it with `keystroke channel update-binding --agent <id> --binding <id> --threads` / `--no-threads`.
|
|
19
|
-
|
|
20
|
-
The web app offers the same flow from each agent's **External Channels** panel.
|
|
21
|
-
|
|
22
|
-
## Testing
|
|
23
|
-
|
|
24
|
-
Slack OAuth and the inbound event routes are handled by your **deployed** project — `keystroke dev` (local watch/rebuild) is not in the Slack delivery path. To test Slack end-to-end: `keystroke deploy`, `keystroke connect slack`, `keystroke channel bind …`, then message the bound channel and inspect the session (below).
|
|
25
|
-
|
|
26
|
-
> Self-hosting the keystroke platform is a separate concern: that setup seeds Slack app credentials via platform env vars (`SLACK_CLIENT_ID/SECRET/SIGNING_SECRET`) and a public origin (`PUBLIC_PLATFORM_PROXY_URL`). Those are **platform** vars, not part of a scaffolded user project, and `keystroke dev` does not read them.
|
|
27
|
-
|
|
28
|
-
## Audit
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
keystroke agent sessions list <agent-key> --source gateway
|
|
32
|
-
keystroke agent sessions get <agent-key> <session-id> --include messages,trace
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Common fixes
|
|
36
|
-
|
|
37
|
-
| Issue | Fix |
|
|
38
|
-
| ------------- | -------------------------------------------------- |
|
|
39
|
-
| 401 on events | Check the signing secret in the Slack connection |
|
|
40
|
-
| No reply | Session errors via `keystroke agent sessions list` |
|
|
41
|
-
| Wrong agent | Re-bind with `keystroke channel bind` |
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: keystroke-cli
|
|
3
|
-
description: Keystroke CLI — log in, manage projects, deploy your src/, and run/inspect what's deployed (workflows, agents, triggers, apps). Use when running keystroke commands for a project.
|
|
4
|
-
metadata:
|
|
5
|
-
keystroke-domain: cli
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# CLI
|
|
9
|
-
|
|
10
|
-
The CLI is the primary interface for keystroke projects. You build in `src/`, deploy to your project on the platform, then run and inspect what's deployed. The loop is **edit → deploy → run/inspect → repeat**; deploy often.
|
|
11
|
-
|
|
12
|
-
## Log in
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
keystroke auth login # once; token stored in the OS keychain and reused
|
|
16
|
-
keystroke auth login --org <org-slug> # headless org pick
|
|
17
|
-
keystroke config org # list org memberships
|
|
18
|
-
keystroke config use org <org-slug> # switch active org
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
One login covers every command. `auth login` auto-picks your org if you have one and prompts if there are several.
|
|
22
|
-
|
|
23
|
-
## Projects
|
|
24
|
-
|
|
25
|
-
A **project** is your deploy target on the platform. `keystroke init` scaffolds the local repo; the platform project is where it runs.
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
keystroke project list
|
|
29
|
-
keystroke project create --name "My app" --description "Optional"
|
|
30
|
-
keystroke deploy --project <id> # build + upload src/; see deploy skill for --filter
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
`--project` selects the deploy target. It's a global flag that works before or after the subcommand (`keystroke deploy --project <id>`).
|
|
34
|
-
|
|
35
|
-
New projects are **inactive** until the first deploy. After a deploy, `keystroke deploy` remembers the project (saved in `~/.keystroke`), so later commands target it without `--project`. To switch which project later commands use:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
keystroke config use project <id>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
To target a different project for a single command without changing the default:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
keystroke workflow runs list greeting --project <id>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
By default the CLI targets the cloud platform. To run commands against a locally running server (`keystroke start` / `keystroke dev`), use the global `--local` flag for one command, or `keystroke config use local` / `keystroke config use cloud` to switch the default target.
|
|
48
|
-
|
|
49
|
-
Full deploy, filtered module redeploy, and WIP ignore: [deploy skill](../keystroke-deploy/SKILL.md).
|
|
50
|
-
|
|
51
|
-
## Pull an existing project
|
|
52
|
-
|
|
53
|
-
`keystroke pull` is the inverse of `deploy`: it downloads a project's **active deploy source** into a local directory, installs dependencies, and syncs bundled skills. Use it to start working on a project that was created or deployed elsewhere (e.g. on a fresh machine).
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
keystroke pull --project <id> # into the current directory
|
|
57
|
-
keystroke pull --project <id> --dir ./my-app
|
|
58
|
-
keystroke pull --project <id> --force # overwrite an existing local tree
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
It targets the active project when `--project` is omitted. A directory that already holds an unrelated project is refused unless you pass `--force`; a directory from a prior pull of the **same** project refreshes in place, and a no-op pull (already on the active artifact) exits without changes.
|
|
62
|
-
|
|
63
|
-
## Run & inspect
|
|
64
|
-
|
|
65
|
-
After deploy, runtime commands operate on your project:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
keystroke workflow run greeting --input '{"name":"Ada"}'
|
|
69
|
-
keystroke workflow runs list greeting
|
|
70
|
-
keystroke workflow runs get greeting <run-id> --include steps,trace
|
|
71
|
-
keystroke agent prompt hello --message "Hi"
|
|
72
|
-
keystroke agent sessions get support <session-id> --include messages,trace
|
|
73
|
-
keystroke app list
|
|
74
|
-
keystroke trigger list
|
|
75
|
-
keystroke trigger list --endpoint stripe # all webhooks on a shared endpoint
|
|
76
|
-
keystroke trigger url stripe # shared route URL (or a trigger key)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Always use the CLI to inspect runs and sessions — do not hand-craft HTTP requests.
|
|
80
|
-
|
|
81
|
-
## Commands at a glance
|
|
82
|
-
|
|
83
|
-
| Command | What it does |
|
|
84
|
-
| -------------------------------------------------- | -------------------------------------------------------- |
|
|
85
|
-
| `auth login` | Authenticate; token reused for all commands |
|
|
86
|
-
| `project list`, `project create` | Manage deploy targets in the active org |
|
|
87
|
-
| `deploy` | Build `src/` and ship it; sets the active project |
|
|
88
|
-
| `pull` | Download a project's active deploy source into a local dir |
|
|
89
|
-
| `workflow`, `agent`, `trigger`, `app` | Run and inspect resources on your project |
|
|
90
|
-
| `connect <slug>` | Connect an integration (see apps skill) |
|
|
91
|
-
| `config use project <id>`, `config show` | Set/inspect the active project |
|
|
92
|
-
|
|
93
|
-
Related: [deploy](../keystroke-deploy/SKILL.md), [apps](../keystroke-apps/SKILL.md), [workflows](../keystroke-workflows/SKILL.md), [agents](../keystroke-agents/SKILL.md), [triggers](../keystroke-triggers/SKILL.md).
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: keystroke-deploy
|
|
3
|
-
description: Build and deploy keystroke projects — full deploy, filtered module redeploy, @keystroke ignore for WIP modules. Use when shipping to the platform or keeping draft code out of production.
|
|
4
|
-
metadata:
|
|
5
|
-
keystroke-domain: deploy
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Deploy
|
|
9
|
-
|
|
10
|
-
Deploy uploads a `dist/` tarball to the keystroke **platform** and promotes a new project-server runtime (blue/green). Use this skill when shipping your project to the platform.
|
|
11
|
-
|
|
12
|
-
## Prerequisites
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
keystroke auth login
|
|
16
|
-
keystroke project list # or: project create --name "My app"
|
|
17
|
-
keystroke deploy --project <slug> # first deploy must be full (no --filter)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
`--project` selects the deploy target; as a global flag it works before or after `deploy`. After a successful deploy the project becomes the active target (saved in `~/.keystroke`), so later commands (including subsequent deploys) can omit it.
|
|
21
|
-
|
|
22
|
-
Deploy always **builds before upload**. Full deploy wipes `dist/` (`clean: true`), rebuilds all modules, regenerates `route-manifest.json`, then packs and uploads.
|
|
23
|
-
|
|
24
|
-
## Full deploy
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
keystroke build # optional preview; deploy rebuilds anyway
|
|
28
|
-
keystroke deploy --project <slug>
|
|
29
|
-
keystroke deploy --project <slug> --dir ./my-app
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
After success the project becomes the active target for later commands. Verify with `keystroke workflow run <key> --input '{}'`.
|
|
33
|
-
|
|
34
|
-
## Filtered deploy (one module)
|
|
35
|
-
|
|
36
|
-
Redeploy a single agent/workflow/trigger without rebuilding everything. Requires an **active** artifact from a prior full deploy.
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
keystroke deploy --project <slug> --filter workflows/morning-check
|
|
40
|
-
keystroke deploy --project <slug> --filter agents/support --filter workflows/signup-pipeline
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
`--filter` matches exact build entry keys (`agents/foo`, `workflows/bar`, `triggers/baz`) — the paths under `src/` without extension. Repeat the flag for multiple modules. No globs.
|
|
44
|
-
|
|
45
|
-
**How it works:** isolated rebuild of each matched module → download active prod tarball → overlay rebuilt `.mjs` files → merge `route-manifest.json` by module → upload as a normal full deploy.
|
|
46
|
-
|
|
47
|
-
**Carried forward from prod:** `config.mjs`, bundled assets, skills metadata, and all untouched modules. Skill/asset drift is not validated in v1.
|
|
48
|
-
|
|
49
|
-
Detail: [filtered-deploy.md](references/filtered-deploy.md).
|
|
50
|
-
|
|
51
|
-
## WIP modules (`@keystroke ignore`)
|
|
52
|
-
|
|
53
|
-
Keep draft agents/workflows/triggers in `src/` but out of the runtime:
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
// @keystroke ignore // skip local build, dev, and deploy
|
|
57
|
-
// @keystroke ignore:deploy // local build + dev only; omitted from deploy
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
- `ignore` — broken or not-ready; stays out of `dist/` everywhere.
|
|
61
|
-
- `ignore:deploy` — runs locally; excluded from deploy only.
|
|
62
|
-
|
|
63
|
-
Import guard: a shipped module that **imports** an `@keystroke ignore` file fails the build in **every** phase; importing an `@keystroke ignore:deploy` file builds fine locally and fails only at **deploy** time. Triggers attached to an ignored workflow need the same directive.
|
|
64
|
-
|
|
65
|
-
Detail: [wip-ignore.md](references/wip-ignore.md).
|
|
66
|
-
|
|
67
|
-
## Build vs deploy
|
|
68
|
-
|
|
69
|
-
| Command | Phase | Output |
|
|
70
|
-
| ------------------ | ------- | ------------------------------------------- |
|
|
71
|
-
| `keystroke build` | `build` | `dist/` for inspection |
|
|
72
|
-
| `keystroke deploy` | `deploy`| `dist/` + upload; honors `ignore:deploy` |
|
|
73
|
-
|
|
74
|
-
Deploy always runs a fresh, clean build before upload.
|
|
75
|
-
|
|
76
|
-
Detail: [build-and-full-deploy.md](references/build-and-full-deploy.md).
|
|
77
|
-
|
|
78
|
-
## Common mistakes
|
|
79
|
-
|
|
80
|
-
- **First deploy with `--filter`** — fails; run full deploy once.
|
|
81
|
-
- **Wrong `--dir`** — builds a different tree than you edited.
|
|
82
|
-
- **Expecting full refresh with `--filter`** — only matched modules rebuild; rest comes from active prod.
|
|
83
|
-
- **Connected apps aren't in `.env`** — deploy never uploads `.env`; connect apps for your project. See [apps skill](../keystroke-apps/SKILL.md).
|
|
84
|
-
|
|
85
|
-
## Audit deployed runtime
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
keystroke project deployments list --project <slug>
|
|
89
|
-
keystroke workflow run morning-check --input '{}'
|
|
90
|
-
keystroke trigger list
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Related: [cli skill](../keystroke-cli/SKILL.md), [apps skill](../keystroke-apps/SKILL.md).
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Build and full deploy
|
|
2
|
-
|
|
3
|
-
## What deploy does
|
|
4
|
-
|
|
5
|
-
1. `walkProject` with `phase: "deploy"` — applies `@keystroke ignore:deploy`, collects source snapshot for the dashboard.
|
|
6
|
-
2. `buildApp` — tsdown with `clean: true`; writes `dist/` and `dist/.keystroke/route-manifest.json`.
|
|
7
|
-
3. `packProjectArtifact` — gzip tarball of `dist/`.
|
|
8
|
-
4. Platform `artifacts.create` → PUT tarball → `complete` → blue/green promote.
|
|
9
|
-
|
|
10
|
-
Source files upload in parallel (content-addressed); failure there warns but does not block deploy. The dashboard source snapshot is capped (per-file 256KB, total 8MB, 2000 files) and skips binaries, `.env`, and `.log` files — so `.env` is never uploaded.
|
|
11
|
-
|
|
12
|
-
After upload, the CLI polls the project status (every ~2s, up to a 120s timeout) until it reports `active` or `failed`; on failure it surfaces the platform's `lastError`. A hang usually means the platform promotion is still in progress.
|
|
13
|
-
|
|
14
|
-
## Entry keys
|
|
15
|
-
|
|
16
|
-
Build entry keys mirror `dist/` paths without `.mjs`:
|
|
17
|
-
|
|
18
|
-
| Source file | Entry key |
|
|
19
|
-
| ------------------------------ | ---------------------- |
|
|
20
|
-
| `src/agents/support.ts` | `agents/support` |
|
|
21
|
-
| `src/workflows/morning-check.ts` | `workflows/morning-check` |
|
|
22
|
-
| `src/triggers/incoming-message.ts` | `triggers/incoming-message` |
|
|
23
|
-
|
|
24
|
-
Nested agent dirs use the same `agents/<id>` pattern from discovery.
|
|
25
|
-
|
|
26
|
-
## Freshness
|
|
27
|
-
|
|
28
|
-
Full deploy always runs `buildApp` before pack. Default `clean: true` removes prior `dist/` output before rebuild. You do not need a separate `keystroke build` before deploy.
|
|
29
|
-
|
|
30
|
-
Orphan files from removed modules are unlikely to affect routing — `route-manifest.json` is regenerated and drives HTTP routes.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Filtered deploy (`--filter`)
|
|
2
|
-
|
|
3
|
-
Ship changes to one or a few modules without a full rebuild of every agent, workflow, and trigger.
|
|
4
|
-
|
|
5
|
-
## Command
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
keystroke deploy --project <slug> --filter workflows/morning-check
|
|
9
|
-
keystroke deploy --project <slug> --filter agents/support --filter workflows/signup-pipeline
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
(`--project` can go before or after `deploy`, and can be omitted after the first deploy.)
|
|
13
|
-
|
|
14
|
-
- Exact entry keys only — no globs, no negation, no slug aliases.
|
|
15
|
-
- First deploy for a project must be **full** (no `--filter`).
|
|
16
|
-
- Without an active artifact, deploy errors: run a full deploy first.
|
|
17
|
-
|
|
18
|
-
## Pipeline
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
isolated single-entry build per --filter match (self-contained .mjs)
|
|
22
|
-
→ download active prod tarball
|
|
23
|
-
→ extract → overlay rebuilt files → merge route-manifest by moduleFile
|
|
24
|
-
→ re-tar → normal artifacts.create / PUT / complete
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Isolated builds
|
|
28
|
-
|
|
29
|
-
Each filtered module is built alone in a scratch dir. Output is self-contained (no shared `../chunk-*.mjs` imports). The merge overlays only `dist/<kind>/<id>.mjs` (+ `.map`) onto the extracted prod tree.
|
|
30
|
-
|
|
31
|
-
## Manifest merge
|
|
32
|
-
|
|
33
|
-
For each rebuilt module, base manifest entries with the same `moduleFile` are dropped; rebuilt entries are appended. Health, plugins, skills, integrations, and untouched modules stay from the active artifact.
|
|
34
|
-
|
|
35
|
-
## What is not rebuilt
|
|
36
|
-
|
|
37
|
-
- `config.mjs` and built-in integration routes
|
|
38
|
-
- `dist/.keystroke/assets.mjs` and skill files on disk
|
|
39
|
-
- Any module not listed in `--filter`
|
|
40
|
-
|
|
41
|
-
Change `keystroke.config.ts` or project-wide assets → run a **full** deploy.
|
|
42
|
-
|
|
43
|
-
## Verify
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
keystroke project deployments list --project <slug> # new version active
|
|
47
|
-
keystroke workflow run <workflow-slug> --input '{}'
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Confirm untouched routes still work after a filtered deploy of a different module.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# WIP modules and `@keystroke ignore`
|
|
2
|
-
|
|
3
|
-
Place the directive in the **leading comment block** of a module file under `src/agents/`, `src/workflows/`, or `src/triggers/` (the scan stops at the first non-comment line). Line (`//`) and block (`/* … */`, `*`) comments both work.
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
// @keystroke ignore
|
|
7
|
-
// @keystroke ignore:deploy
|
|
8
|
-
/** @keystroke ignore */
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Only `ignore` and `ignore:deploy` are valid. Any other scope (e.g. `// @keystroke ignore:build`) throws `Unknown @keystroke ignore target "…"` at build time.
|
|
12
|
-
|
|
13
|
-
## Directives
|
|
14
|
-
|
|
15
|
-
| Directive | Local build (`build`, `dev`, `start`) | Deploy (`phase: deploy`) |
|
|
16
|
-
| ---------------------- | ------------------------------------- | ------------------------ |
|
|
17
|
-
| `// @keystroke ignore` | Skipped | Skipped |
|
|
18
|
-
| `// @keystroke ignore:deploy` | Included | Skipped |
|
|
19
|
-
|
|
20
|
-
## When to use which
|
|
21
|
-
|
|
22
|
-
- **`ignore`** — module is broken, experimental, or not ready to run anywhere.
|
|
23
|
-
- **`ignore:deploy`** — safe to run locally; not ready for production yet.
|
|
24
|
-
|
|
25
|
-
## Import guard
|
|
26
|
-
|
|
27
|
-
If a **shipped** module imports a file marked `@keystroke ignore`, the build **fails in every phase**. If it imports an `@keystroke ignore:deploy` file, the local build/dev succeeds and only the **deploy** build fails (because `ignore:deploy` files are excluded only in the deploy phase). Compose in workflows instead of importing ignored actions from production modules.
|
|
28
|
-
|
|
29
|
-
## Triggers
|
|
30
|
-
|
|
31
|
-
A trigger attached to an ignored workflow should use the same ignore treatment, or the attachment will not behave as expected across build phases.
|
|
32
|
-
|
|
33
|
-
## Filtered deploy note
|
|
34
|
-
|
|
35
|
-
`ignore:deploy` omits a module from the **new** build. It does **not** keep the last prod version — full deploy replaces the entire artifact. Use filtered deploy when you want to update one live module while carrying forward the rest of prod.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: keystroke-files
|
|
3
|
-
description: Add static files to agent workspaces from src/files/ — product docs, instructions, context. Use with defineSandbox on defineAgent.
|
|
4
|
-
metadata:
|
|
5
|
-
keystroke-domain: files
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Files
|
|
9
|
-
|
|
10
|
-
Files under `src/files/` mount into the agent sandbox at `/workspace/agent/`.
|
|
11
|
-
|
|
12
|
-
## Layout
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
src/files/support/
|
|
16
|
-
product-guide.md
|
|
17
|
-
support-instructions.md
|
|
18
|
-
runbooks/
|
|
19
|
-
refunds.md
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Nested directories are preserved — `src/files/support/runbooks/refunds.md` mounts at `/workspace/agent/runbooks/refunds.md`.
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { defineAgent } from "@keystrokehq/keystroke/agent";
|
|
26
|
-
import { defineSandbox } from "@keystrokehq/keystroke/sandbox";
|
|
27
|
-
|
|
28
|
-
export default defineAgent({
|
|
29
|
-
slug: "support",
|
|
30
|
-
systemPrompt: "Read /workspace/agent/product-guide.md before answering.",
|
|
31
|
-
sandbox: defineSandbox({ files: true }), // uses agent slug → src/files/support/
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Use `defineSandbox({ files: "shared" })` to mount `src/files/shared/` instead — the string value names the folder under `src/files/`.
|
|
36
|
-
|
|
37
|
-
If the named folder doesn't exist, the build fails with a clear error — create the folder (it must contain at least one file) before deploying.
|
|
38
|
-
|
|
39
|
-
Files are seeded **write-once** at sandbox startup: the agent can edit them at runtime, but those edits aren't persisted back to `src/files/` and reset on the next run. Treat `src/files/` as read-only seed content.
|
|
40
|
-
|
|
41
|
-
Point the agent at paths in `systemPrompt`. After deploy, verify behavior with `keystroke agent prompt support --message "…"`.
|
|
42
|
-
|
|
43
|
-
Related: [agents](.agents/skills/keystroke-agents/SKILL.md), [skills](.agents/skills/keystroke-skills/SKILL.md).
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: keystroke-skills
|
|
3
|
-
description: Add Agent Skills playbooks in src/skills/ for defineAgent — SKILL.md format, optional references. Use when giving agents domain-specific instructions.
|
|
4
|
-
metadata:
|
|
5
|
-
keystroke-domain: skills
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Project skills
|
|
9
|
-
|
|
10
|
-
Skills are playbooks the agent loads on demand. Author in `src/skills/`, attach by folder name on the agent.
|
|
11
|
-
|
|
12
|
-
## Layout
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
src/skills/support/
|
|
16
|
-
SKILL.md
|
|
17
|
-
references/refund-policy.md # optional
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
defineAgent({
|
|
22
|
-
slug: "support",
|
|
23
|
-
skills: ["support"] /* … */,
|
|
24
|
-
});
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
At runtime → `/workspace/agent/skills/support/`.
|
|
28
|
-
|
|
29
|
-
## SKILL.md
|
|
30
|
-
|
|
31
|
-
Follow [Agent Skills](https://agentskills.io/specification): YAML frontmatter with `name` (matches the folder) and `description` are the required fields; everything else (e.g. `metadata`) is optional. Keep the body short; put detail in `references/`.
|
|
32
|
-
|
|
33
|
-
## Two kinds of skills (don't confuse them)
|
|
34
|
-
|
|
35
|
-
- **`src/skills/`** — *project* Agent Skills attached to your agents via `skills: [...]`. They deploy with your project; inspect deployed ones with `keystroke skill list`.
|
|
36
|
-
- **`.agents/skills/`** — the *bundled coding-agent* guides (like this one) that `keystroke init` scaffolds. Refresh them to the current CLI version with `keystroke skills sync` (note the plural `skills`).
|
|
37
|
-
|
|
38
|
-
## External registries
|
|
39
|
-
|
|
40
|
-
Browse [skills.sh](https://skills.sh) — copy into `src/skills/{name}/` and fix `name` to match the folder.
|
|
41
|
-
|
|
42
|
-
Related: [agents](.agents/skills/keystroke-agents/SKILL.md), [files](.agents/skills/keystroke-files/SKILL.md).
|