Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .changeset/breezy-cloths-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"stash": minor
"@cipherstash/wizard": patch
---

Rename the CLI package from `@cipherstash/cli` to `stash`. The published code, commands, and flags are unchanged — this is a pure rename so the day-to-day invocation drops from `npx @cipherstash/cli ...` to `npx stash ...`.

**Migration**

1. Update your `package.json` devDependencies:

```diff
- "@cipherstash/cli": "^0.10.0"
+ "stash": "^0.10.1"
```

2. Update the `defineConfig` import in `stash.config.ts`:

```diff
- import { defineConfig } from '@cipherstash/cli'
+ import { defineConfig } from 'stash'
```

3. Update any `npx @cipherstash/cli ...` / `bunx @cipherstash/cli ...` / `pnpm dlx @cipherstash/cli ...` / `yarn dlx @cipherstash/cli ...` invocations in scripts, CI, READMEs, and team docs to use `stash` instead. Programmatic exports (`defineConfig`, `loadStashConfig`, `EQLInstaller`, `loadBundledEqlSql`, `downloadEqlSql`, `PermissionCheckResult`) are re-exported from `stash` with the same shapes.

**Wizard impact (`@cipherstash/wizard`)**

The wizard's post-agent step and its prerequisite / agent-error hints now reference `stash` (e.g. `Run: bunx stash auth login`, `Running bunx stash db install...`) rather than `@cipherstash/cli`. The wizard package name and `stash-wizard` binary are unchanged — only the strings the wizard prints and the commands it shells out to are affected.
4 changes: 2 additions & 2 deletions .changeset/cli-database-url-resolution.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@cipherstash/cli': minor
'stash': minor
---

Layered `DATABASE_URL` resolution for DB / schema commands.
Expand All @@ -16,7 +16,7 @@ if `DATABASE_URL` wasn't already in the environment. The CLI auto-loaded `.env.l
The scaffolded `stash.config.ts` now calls a resolver directly:

```ts
import { defineConfig, resolveDatabaseUrl } from '@cipherstash/cli'
import { defineConfig, resolveDatabaseUrl } from 'stash'

export default defineConfig({
databaseUrl: await resolveDatabaseUrl(),
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
# pseudo-terminal via node-pty. Run via turbo so the `^build` + `build`
# deps declared on the `test:e2e` task are honored.
- name: Run CLI E2E tests
run: pnpm exec turbo run test:e2e --filter @cipherstash/cli
run: pnpm exec turbo run test:e2e --filter stash

e2e-tests:
name: Run E2E Tests
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pnpm changeset:publish
- Prefer testing via the public API. Avoid reaching into private internals.
- Some tests have larger timeouts (e.g., 30s) to accommodate network calls.
- `packages/cli` has a second suite — pty-driven E2E tests under
`packages/cli/tests/e2e/**` run via `pnpm --filter @cipherstash/cli
`packages/cli/tests/e2e/**` run via `pnpm --filter stash
test:e2e` (requires a build). See `packages/cli/AGENTS.md` for when to
add or update them.

Expand Down
6 changes: 3 additions & 3 deletions docs/plans/cli-pty-integration-tests.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Plan: node-pty Integration Tests for `@cipherstash/cli`
# Plan: node-pty Integration Tests for `stash`

## Goal

Expand Down Expand Up @@ -75,7 +75,7 @@ harness is proven.
7. `turbo.json` task `test:e2e` with `dependsOn: ["^build", "build"]` so
the CLI is rebuilt before E2E runs. Keep `cache: false`.
8. CI: extend the existing test workflow to also run `pnpm --filter
@cipherstash/cli test:e2e`. Confirm the prebuilt binary resolves on
stash test:e2e`. Confirm the prebuilt binary resolves on
the GH runners (Linux x64, macOS arm64). If it doesn't, fall back to
upstream `node-pty` and add `python3` / build tools to the workflow.

Expand Down Expand Up @@ -182,7 +182,7 @@ export const messages = {
},
db: {
migrateNotImplemented:
'"npx @cipherstash/cli db migrate" is not yet implemented.',
'"npx stash db migrate" is not yet implemented.',
},
} as const
```
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:e2e": "vitest run"
},
"dependencies": {
"@cipherstash/cli": "workspace:*",
"stash": "workspace:*",
"@cipherstash/wizard": "workspace:*"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions e2e/tests/package-managers.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ describe('CLI init providers — package-manager-aware Next Steps', () => {
label: 'base',
create: createBaseProvider,
firstStep: (r) =>
`Set up your database: ${r} @cipherstash/cli db install`,
`Set up your database: ${r} stash db install`,
},
{
label: 'drizzle',
create: createDrizzleProvider,
firstStep: (r) =>
`Set up your database: ${r} @cipherstash/cli db install --drizzle`,
`Set up your database: ${r} stash db install --drizzle`,
},
{
label: 'supabase',
create: createSupabaseProvider,
firstStep: (r) =>
`Install EQL: ${r} @cipherstash/cli db install --supabase (prompts for migration vs direct)`,
`Install EQL: ${r} stash db install --supabase (prompts for migration vs direct)`,
},
]

Expand Down Expand Up @@ -141,12 +141,12 @@ describe.skipIf(!authConfigured)(
{ pm: 'yarn' as const, lockfile: 'yarn.lock' },
])('uses $pm runner when $lockfile is present', ({ pm, lockfile }) => {
const out = runWizard({ lockfile })
expect(out).toContain(`Run: ${RUNNER[pm]} @cipherstash/cli db install`)
expect(out).toContain(`Run: ${RUNNER[pm]} stash db install`)
})

it('falls back to npx when no lockfile and no user agent', () => {
const out = runWizard({})
expect(out).toContain('Run: npx @cipherstash/cli db install')
expect(out).toContain('Run: npx stash db install')
})
})

Expand All @@ -157,7 +157,7 @@ describe.skipIf(!authConfigured)(
{ pm: 'yarn' as const, userAgent: 'yarn/4.0.0 npm/? node/v20.0.0' },
])('uses $pm runner when UA is $userAgent', ({ pm, userAgent }) => {
const out = runWizard({ userAgent })
expect(out).toContain(`Run: ${RUNNER[pm]} @cipherstash/cli db install`)
expect(out).toContain(`Run: ${RUNNER[pm]} stash db install`)
})
})

Expand All @@ -167,15 +167,15 @@ describe.skipIf(!authConfigured)(
lockfile: 'pnpm-lock.yaml',
userAgent: 'bun/1.1.40 npm/? node/v22.3.0',
})
expect(out).toContain('Run: bunx @cipherstash/cli db install')
expect(out).toContain('Run: bunx stash db install')
})

it('npm user agent is ignored in favour of a lockfile', () => {
const out = runWizard({
lockfile: 'bun.lock',
userAgent: 'npm/10.2.4 node/v20.0.0',
})
expect(out).toContain('Run: bunx @cipherstash/cli db install')
expect(out).toContain('Run: bunx stash db install')
})
})
},
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pg": "8.13.1"
},
"devDependencies": {
"@cipherstash/cli": "workspace:*",
"stash": "workspace:*",
"tsx": "catalog:repo",
"typescript": "catalog:repo"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/stash.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@cipherstash/cli'
import { defineConfig } from 'stash'

export default defineConfig({
databaseUrl: process.env.DATABASE_URL!,
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# `@cipherstash/cli` — agent notes
# `stash` — agent notes

## Two test suites

This package has **two** Vitest configs. Run the right one for the change.

| Command | Config | Scope | Needs build? |
| --- | --- | --- | --- |
| `pnpm --filter @cipherstash/cli test` | `vitest.config.ts` | Unit tests under `src/__tests__/**` and `src/**/__tests__/**` | No |
| `pnpm --filter @cipherstash/cli test:e2e` | `vitest.integration.config.ts` | E2E tests under `tests/e2e/**.e2e.test.ts` driving the built `dist/bin/stash.js` through a real pty (`node-pty`) | **Yes** — run `pnpm --filter @cipherstash/cli build` first, or use the turbo `test:e2e` task which depends on `build`. |
| `pnpm --filter stash test` | `vitest.config.ts` | Unit tests under `src/__tests__/**` and `src/**/__tests__/**` | No |
| `pnpm --filter stash test:e2e` | `vitest.integration.config.ts` | E2E tests under `tests/e2e/**.e2e.test.ts` driving the built `dist/bin/stash.js` through a real pty (`node-pty`) | **Yes** — run `pnpm --filter stash build` first, or use the turbo `test:e2e` task which depends on `build`. |

The unit config explicitly excludes `tests/e2e/**` so the default `pnpm test`
stays fast and self-contained.
Expand Down
Loading
Loading