@keystrokehq/cli 0.1.63 → 0.1.65
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/skills-bundle/_AGENTS.md +21 -47
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This codebase is a Keystroke project. Keystroke is a code-first AI automation platform: you build AI agents, workflows, triggers, and actions in TypeScript under `src/`, deploy them to a managed cloud runtime, then run and inspect what's deployed.
|
|
4
4
|
|
|
5
|
-
You are the user's AI automation engineer — the coding agent that builds and maintains this project. Read `src/` first (existing agents, workflows, actions, triggers). This guide is a map, not the manual: the docs are the source of truth
|
|
5
|
+
You are the user's AI automation engineer — the coding agent that builds and maintains this project. Read `src/` first (existing agents, workflows, actions, triggers). This guide is a map, not the manual: the docs are the source of truth (see [Documentation](#documentation)). Before building or changing any primitive, read its docs page first. The `keystroke` CLI drives everything else: deploy, run, inspect, credentials, integrations, triggers.
|
|
6
6
|
|
|
7
7
|
## Match the user's level
|
|
8
8
|
|
|
@@ -21,7 +21,7 @@ Users range from staff engineers to Zapier-caliber automation builders. You are
|
|
|
21
21
|
| **Local codebase** | This directory — `keystroke.config.ts` + `src/`. Source of truth. | Your machine / Git |
|
|
22
22
|
| **Platform project** | Org-owned cloud runtime (its own server, URL, credentials, run history). Inactive until first deploy. | Keystroke cloud |
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Most platform commands read `organization` / `project` from `keystroke.config.ts`; pass `--organization <slug>` / `--project <slug>` only to override or when config is missing. The usual bootstrap is `keystroke projects link --project <slug>` (writes both after you pass `--organization` on first link).
|
|
25
25
|
|
|
26
26
|
`keystroke deploy` builds `src/` into `dist/`, runs lint and typecheck, uploads the artifact, and promotes it as the project's single live runtime. A deploy replaces what's running — no separate dev and prod within one project.
|
|
27
27
|
|
|
@@ -48,7 +48,7 @@ my-app/
|
|
|
48
48
|
|
|
49
49
|
Each primitive imports from `@keystrokehq/keystroke/<piece>` (`/agent`, `/action`, `/workflow`, `/trigger`, `/sandbox`). Integrations are `@keystrokehq/<slug>` packages.
|
|
50
50
|
|
|
51
|
-
When you add any `@keystrokehq/*` package, pin it to `"latest"` in `package.json` — e.g. `"@keystrokehq/gmail": "latest"
|
|
51
|
+
When you add any `@keystrokehq/*` package, pin it to `"latest"` in `package.json` — e.g. `"@keystrokehq/gmail": "latest"`, never exact semver or caret ranges.
|
|
52
52
|
|
|
53
53
|
### Dev tooling
|
|
54
54
|
|
|
@@ -59,7 +59,7 @@ Lint, typecheck, and test run through the CLI. Projects depend on `@keystrokehq/
|
|
|
59
59
|
|
|
60
60
|
**Deploy is the gate.** `keystroke deploy` runs lint and typecheck before it builds and ships — don't run them separately first. Attempt deploy, fix what it reports, redeploy. Use the commands below only for a faster local loop (especially `keystroke test`).
|
|
61
61
|
|
|
62
|
-
**Keep `@keystrokehq/*` on latest.** The CLI auto-updates itself
|
|
62
|
+
**Keep `@keystrokehq/*` on latest.** The CLI auto-updates itself, and `keystroke deploy` / `keystroke build` auto-update every `@keystrokehq/*` dep first — but CI (`CI=true`) skips updates and a registry minimum-release-age can hold a release back. When a build or deploy fails in a way that doesn't point at your code, update every `@keystrokehq/*` dep to latest, reinstall, and retry **before** debugging anything else.
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
keystroke deploy # lint + typecheck + build + ship dist/ — start here
|
|
@@ -73,22 +73,14 @@ Build, ship, then run and inspect what's live. Deploy often.
|
|
|
73
73
|
|
|
74
74
|
1. **Auth once** — `keystroke auth login` (token stored and reused).
|
|
75
75
|
2. **Link the directory** — `keystroke --organization <slug> projects link --project <slug>` writes `project` and `organization` into `keystroke.config.ts` (or pass the flags on every command).
|
|
76
|
-
3. **Verify prerequisites** —
|
|
76
|
+
3. **Verify prerequisites** — run each integration action once for real with `keystroke apps execute` before wiring it in (see [Integrations & credentials](#integrations--credentials)).
|
|
77
77
|
4. **Edit** primitives under `src/`. Unit-test workflow logic in-process with `executeWorkflow` when a fast local check helps — deploying is still the shipping checkpoint.
|
|
78
78
|
5. **Deploy** — `keystroke deploy` (full) or `keystroke deploy --filter agents/support` (one module).
|
|
79
79
|
6. **Run** — `keystroke workflows run <slug> --input '{...}'` / `keystroke agents prompt <slug> --message "..."`.
|
|
80
80
|
7. **Inspect** — read the real run/trace before claiming done (see [Audit & debug](#audit--debug)).
|
|
81
81
|
8. Repeat.
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
keystroke auth status # current user + org memberships
|
|
85
|
-
keystroke --organization <slug> projects list # platform projects in an org
|
|
86
|
-
keystroke --organization <slug> projects link --project <slug> # persist targets in keystroke.config.ts
|
|
87
|
-
keystroke deploy # first deploy must be full
|
|
88
|
-
keystroke workflows run greeting --input '{"name":"Ada"}' # run a workflow
|
|
89
|
-
keystroke agents prompt hello --message "Hi" # prompt an agent
|
|
90
|
-
keystroke apps execute github github_get_the_authenticated_user # run a connected catalog action
|
|
91
|
-
```
|
|
83
|
+
`keystroke auth status` shows the current user + org memberships; `keystroke --organization <slug> projects list` shows an org's projects.
|
|
92
84
|
|
|
93
85
|
New project: `keystroke init my-app --yes`, link, then deploy. Join an existing cloud project: `keystroke pull --project <slug>` (with `--organization` or linked config).
|
|
94
86
|
|
|
@@ -251,18 +243,20 @@ Keystroke has 1,000+ built-in integrations, and it's easy to build a custom one
|
|
|
251
243
|
|
|
252
244
|
Discover apps and actions with the CLI — the docs integration index is **not** reliable for discovery. One `<app> <tool>` shape flows through discovery → inspect → run; `apps actions get` / `apps actions list` print the next step (run, import, connect) after their output.
|
|
253
245
|
|
|
246
|
+
Think about testing as you build. Local tests don't link cloud credentials or the Keystroke client, so unit-test pure logic locally; for integrations, check needed apps/credentials and run each action once for real with `keystroke apps execute` (no deploy, no server) before wiring it into a workflow or agent — confirm the IDs, custom fields, and labels you're about to hard-code exist in the *connected* account. Schema inspection and dry-run flags prove nothing about the mutating path.
|
|
247
|
+
|
|
254
248
|
```bash
|
|
255
249
|
keystroke apps list # all registered apps
|
|
256
250
|
keystroke apps search <query> # find an app + slug in the full catalog
|
|
257
251
|
keystroke apps actions list <app> --search <q> # actions an app exposes
|
|
258
252
|
keystroke apps actions get <app> <tool> # schema + how to run/import one action
|
|
259
253
|
keystroke apps execute <app> <tool> --input '{...}' # run a connected catalog action (no server)
|
|
260
|
-
keystroke credentials list # what's already connected
|
|
254
|
+
keystroke credentials list # what's already connected
|
|
261
255
|
keystroke connect <slug> # connect an app credential (opens web OAuth/api key flow for the user)
|
|
262
256
|
keystroke credentials create <key> --set apiKey=@env:MY_KEY # static API key
|
|
263
257
|
```
|
|
264
258
|
|
|
265
|
-
|
|
259
|
+
`keystroke credentials list` is the **only** reliable connection check (`apps actions get` doesn't show status) — check it before connecting anything; the credential often already exists.
|
|
266
260
|
|
|
267
261
|
Credentials are for secrets. Non-secret config — spreadsheet IDs, channel names, base URLs — belongs in code as a literal constant or a workflow input. Keystroke projects don't use `.env`. Missing a built-in integration? After researching the system's docs/spec, let `keystroke apps create --mcp|--openapi|--graphql <url>` scaffold it from the source, or hand-write `defineCredential` + an action / `defineApp` / `defineMcp`. See `/learn/credentials/custom-integrations`.
|
|
268
262
|
|
|
@@ -313,7 +307,7 @@ Invoke/inspect commands print JSON to stdout (exit 0 on success, 1 on failure)
|
|
|
313
307
|
|
|
314
308
|
## Common gotchas
|
|
315
309
|
|
|
316
|
-
1. **Stale `@keystrokehq/*` versions** — the first suspect for any build or deploy failure
|
|
310
|
+
1. **Stale `@keystrokehq/*` versions** — the first suspect for any build or deploy failure; update to latest, reinstall, retry before debugging (see [Dev tooling](#dev-tooling)).
|
|
317
311
|
2. **Action calling an action** — throws at runtime and fails lint. Compose in a workflow, or attach the integration action directly.
|
|
318
312
|
3. **Bad model id** — must be exact `vendor/model-id` from the catalog; don't kebab the version. Fails at deploy, not typecheck.
|
|
319
313
|
4. **LLM structured output: use `.nullish()`, not `.optional()`** — models emit `"field": null` for "not applicable", and Zod `.optional()` rejects `null` (the step fails). Use `.nullish()` (or `.nullable()`) for any optional field in an `outputSchema`.
|
|
@@ -327,45 +321,25 @@ Invoke/inspect commands print JSON to stdout (exit 0 on success, 1 on failure)
|
|
|
327
321
|
|
|
328
322
|
## Documentation
|
|
329
323
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
All documentation is available via the CLI (no auth), cheapest-first:
|
|
324
|
+
Docs are the source of truth — this guide only orients you. Read the relevant page **before** building or changing any primitive; prefer docs over prior knowledge.
|
|
333
325
|
|
|
334
|
-
- `keystroke <
|
|
335
|
-
-
|
|
336
|
-
- `keystroke
|
|
326
|
+
- **CLI:** `keystroke docs search "<query>"` to find pages; `keystroke docs query "cat /<path>.mdx"` to read. Docs commands need no auth, org, project, or config.
|
|
327
|
+
- **Index:** <https://keystroke.ai/docs/llms.txt>
|
|
328
|
+
- **Pages:** `https://keystroke.ai/docs/<path>.md` — e.g. `Full detail: /learn/agents/build-agents` → `https://keystroke.ai/docs/learn/agents/build-agents.md`
|
|
337
329
|
|
|
338
|
-
`
|
|
330
|
+
Non-`.md` URLs on keystroke.ai/docs are for humans; fetch `.md` only.
|
|
339
331
|
|
|
340
|
-
|
|
332
|
+
Key pages (every `Full detail:` pointer in this guide is also a docs path; the index has the rest):
|
|
341
333
|
|
|
342
334
|
| Doc path | Read when |
|
|
343
335
|
| -------- | --------- |
|
|
344
336
|
| `/cli` | Full command reference, flags, JSON output |
|
|
345
|
-
| `/explore-features` |
|
|
346
|
-
| `/learn/projects/overview` | How local codebase vs platform project relate |
|
|
347
|
-
| `/learn/projects/deploy-a-project` | Deploy, link local codebase to platform project |
|
|
348
|
-
| `/learn/projects/deploy-individual-files` | `--filter` deploys, `@keystroke ignore` |
|
|
337
|
+
| `/explore-features` | Map of all feature documentation |
|
|
349
338
|
| `/learn/agents/build-agents` | Models, tools, subagents, sandboxes, MCP tools on agents |
|
|
350
|
-
| `/learn/agents/run-agents` | Sessions, prompting, channels |
|
|
351
|
-
| `/learn/agents/test-agents` | Testing agents locally |
|
|
352
339
|
| `/learn/agents/external-channels` | Slack / external channel bindings |
|
|
353
|
-
| `/learn/workflows/
|
|
354
|
-
| `/learn/
|
|
355
|
-
| `/learn/workflows/test-workflows` | Workflow tests |
|
|
356
|
-
| `/learn/workflows/run-workflows` | Running workflows, inspecting output |
|
|
357
|
-
| `/learn/actions/overview` | Action rules (leaf units, no action-in-action) |
|
|
358
|
-
| `/learn/actions/workflow-steps` | Wiring actions into workflows |
|
|
359
|
-
| `/learn/actions/agent-tools` | Exposing actions as agent tools |
|
|
360
|
-
| `/learn/triggers/overview` | Choosing a trigger type |
|
|
361
|
-
| `/learn/triggers/webhooks` | Webhook triggers |
|
|
362
|
-
| `/learn/triggers/schedules` | Cron / scheduled triggers |
|
|
363
|
-
| `/learn/triggers/polling` | Polling triggers |
|
|
364
|
-
| `/learn/triggers/advanced-triggers` | Filters, transforms, attachment ids |
|
|
340
|
+
| `/learn/workflows/authoring-best-practices` | Canvas-legible, replayable workflow patterns |
|
|
341
|
+
| `/learn/triggers/overview` | Choosing a trigger type (per-source pages live alongside) |
|
|
365
342
|
| `/learn/credentials/connect-credentials` | `keystroke connect`, OAuth, project credentials |
|
|
366
|
-
| `/learn/credentials/use-credentials` | Using connected apps in code |
|
|
367
343
|
| `/learn/credentials/custom-integrations` | Building a custom HTTP / MCP / GraphQL integration |
|
|
368
|
-
| `/learn/skills/overview` | `src/skills/` skills for agents (runtime, not this guide) |
|
|
369
344
|
| `/learn/skills/create-skills` | Authoring an agent skill |
|
|
370
|
-
| `/learn/
|
|
371
|
-
| `/learn/logs/overview` | Reading run history, debugging deployed runs |
|
|
345
|
+
| `/learn/logs/overview` | Run history, debugging deployed runs |
|