anhedral 0.22.1 → 0.23.0

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/README.md CHANGED
@@ -1,74 +1,58 @@
1
1
  # Anhedral CLI
2
2
 
3
3
  > [!WARNING]
4
- > Under construction. Commands, generated source and managed integration are evolving.
4
+ > **Under heavy construction.** CLI commands and generated app code may change.
5
5
 
6
- The open-source CLI for building and managing apps through the **Anhedral API**. Use it directly or through the Codex and Claude Code plugin to create projects, upload source, configure environments, deploy apps and read runtime logs.
6
+ Build an app one addition at a time. Generated applications are editable source. Start with a TanStack Start web app and ShadCN components. Add a backend when you need an API, authentication, or a database. Then choose storage, payments, or both.
7
7
 
8
- The plugin guides an agent through CLI commands so you can describe what you want to build in conversation. Platform enforces account, project and deployment permissions. The CLI also generates the **Anhedral Stack** as editable source, starting with web UI and adding backend, storage and payments when needed. Local source generation requires no account.
8
+ <picture>
9
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/anhedral/anhedral-cli/staging/docs/assets/anhedral-stack.png">
10
+ <img src="https://raw.githubusercontent.com/anhedral/anhedral-cli/staging/docs/assets/anhedral-stack-light.png" alt="The CLI creates a TanStack Start web app. The optional backend supports private file storage and subscription payments. An Expo client with Anhedral UI is upcoming.">
11
+ </picture>
9
12
 
10
- ## Start
13
+ **Upcoming** — `pnpm dlx anhedral@latest add cross-platform` will add an Expo client with Anhedral UI.
11
14
 
12
- ```sh
13
- anhedral init my-app
14
- cd my-app
15
- pnpm dev
16
- ```
15
+ ## How to use
17
16
 
18
- Init creates `apps/web` and shared tooling with OJ and TanStack Start server rendering/server functions and editable shadcn starter components. It does not add an API, database, authentication, storage or payments. Preview with `anhedral init my-app --dry-run --json`; use `--skip-install --no-git` for offline source generation.
19
-
20
- ## Add services
17
+ Start with the web app and stop at the stage you need. Storage and payments each require the backend and can be added independently.
21
18
 
22
19
  ```sh
23
- anhedral add backend --dry-run --json
24
- anhedral add backend
25
- anhedral add r2
26
- anhedral add stripe
27
- ```
28
-
29
- `backend` adds Hono, Better Auth and Drizzle/D1 together in one source transaction. `r2` adds private storage; `stripe` adds subscriptions. Both require the backend. Include missing prerequisites explicitly with `anhedral add r2 stripe --with-dependencies`.
30
-
31
- After adding backend, configure `apps/api/.dev.vars` from its example, review the initial SQL and apply it deliberately with `pnpm db:migrate --local`. The OJ development server then runs the web and auxiliary API Workers with local resources. Authentication methods start disabled and need explicit configuration. After adding Stripe, run `pnpm db:generate`, review the billing SQL and migrate before testing webhooks. Builds/startup never migrate databases or activate providers.
32
-
33
- Use `anhedral stack list`, `status` and `doctor` to inspect the Anhedral Stack and its additions. These checks describe source completeness, not live provider readiness. Current public generation is web-only. OJ runs development and builds. Historical generators and framework aliases are removed.
34
-
35
- ## Update an existing project
36
-
37
- Update your agent plugin through its host and select the matching published CLI version. Preview `anhedral stack update --dry-run --json`, review the returned diffs/conflicts, then apply `anhedral stack update --expect-plan <planId> --json`. Updates preserve authored source and stop on customized-file conflicts or a changed plan. They refresh generated runtime/configuration and deployment provenance without running project scripts or installing dependencies. Validate dependencies and the application separately before upload/deployment. See [the operating workflow](docs/software-factory.md).
20
+ # Create the web app
21
+ pnpm dlx anhedral@latest init my-app
22
+ cd my-app
38
23
 
39
- ## Web UI
24
+ # Add an API, authentication, and a database
25
+ pnpm dlx anhedral@latest add backend
40
26
 
41
- Init includes shadcn Button, Input and Label source with standard `components.json` configuration. Use upstream shadcn directly for more components, or replace the UI with any library. There is no Anhedral UI catalog or CLI wrapper.
27
+ # Add private file storage
28
+ pnpm dlx anhedral@latest add storage
42
29
 
43
- ```sh
44
- cd apps/web
45
- pnpm dlx shadcn@4.22.1 add card
30
+ # Add subscription payments
31
+ pnpm dlx anhedral@latest add payment
46
32
  ```
47
33
 
48
- Review diffs and preserve local edits and required upstream notices. The generated `LICENSE.shadcn` accompanies the bundled starter source. See [web UI](docs/ui.md).
49
-
50
- ## Connect to Anhedral
51
-
52
- Local generation requires no account. After browser-approved `login`, use `projects list --human` to discover projects and team IDs. Register your generated application with `projects create --name <name> --link --human`, or connect an existing project with `link --project <uuid> --team <uuid>`. `source upload --dry-run` inspects packaging without uploading; `source upload` sends a resumable immutable checkpoint.
53
-
54
- `deploy plan --manifest <file>`, `deploy prepare` and `deploy status` submit intent and read candidate receipts. Platform independently checks current authority, exact artifacts and runtime admission. Upload/build success does not publish production. Plans report current runtime compatibility and actionable remediation; candidate preparation does not require another person to review the CLI artifact. The current manifest runtime profile is `anhedral-stack`; an application cannot approve itself for hosting.
34
+ Run `pnpm dev` in the project directory to start the app. If you added services, configure them first. [Service setup](docs/capabilities.md) · [Source snapshot for each stage](https://github.com/anhedral/anhedral-cli/tree/staging/examples)
55
35
 
56
- `env list/import/set` manages variable metadata and private imports. Send values through an owner-only file or stdin, never command arguments or chat. `staging status/deploy` operates on ready candidates. `production status` reads production history; `production deploy --candidate <uuid> --name <slug>` requests publication with your existing production permissions, without a second approver for self-service teams. Explicit independent-review team policy remains enforced; `logs` reads redacted runtime events. The Codex and Claude Code plugin provides CLI usage guidance; authentication and managed project operations run through the CLI. See [the operating workflow](docs/software-factory.md#platform-cli-access-and-source-upload).
36
+ Upgrading from 0.22.1? Replace `add r2` with `add storage` and `add stripe` with `add payment`. Existing projects keep their R2 and Stripe configuration.
57
37
 
58
- ## Help and automation
59
-
60
- Run `anhedral --help` or `anhedral help <command>` for contextual examples. Use `--json` for machine-readable stdout, `--quiet` to suppress ordinary output, and `--non-interactive` to avoid approval polling. Platform retains compact JSON by default; `--human` selects readable summaries. Errors remain on stderr with a numeric failure status and recovery guidance.
61
-
62
- ```sh
63
- anhedral completion bash > ~/.anhedral-completion.bash
64
- # Or print zsh completion without changing your shell profile:
65
- anhedral completion zsh
66
- ```
38
+ ### Command reference
67
39
 
68
- ## Development and ownership
40
+ Use `pnpm dlx anhedral@latest <command>`. For arguments and flags, run `pnpm dlx anhedral@latest help <command>`.
69
41
 
70
- Use `pnpm install --frozen-lockfile`, `pnpm build` and focused tests when developing this repository. Generated applications use the versions recorded in their manifests. Run their `pnpm check` and `pnpm audit:deps` before deployment. Existing applications are never reinitialized or silently migrated.
42
+ | Task | Commands |
43
+ | --- | --- |
44
+ | Generate source | `init`, `add` |
45
+ | Inspect or update the stack | `stack list`, `stack status`, `stack doctor`, `stack update` |
46
+ | Manage your session | `login`, `whoami`, `logout` |
47
+ | Connect a project | `projects list`, `projects create`, `link`, `unlink` |
48
+ | Upload source | `source upload`, `source status` |
49
+ | Configure environment variables | `env list`, `env set`, `env import` |
50
+ | Prepare a deployment | `deploy plan`, `deploy prepare`, `deploy status` |
51
+ | Deploy to staging | `staging deploy`, `staging status` |
52
+ | Publish to production | `production deploy`, `production status` |
53
+ | Read runtime logs | `logs` |
54
+ | Get help and shell completions | `help`, `--version`, `completion bash`, `completion zsh` |
71
55
 
72
- See [stack conventions](docs/stack-standard.md), [additions](docs/capabilities.md), [UI](docs/ui.md) and [workflow](docs/software-factory.md).
56
+ Use the CLI directly or through the Codex and Claude Code plugin. To host on Anhedral, sign in, link a project, upload source, and deploy. [Platform workflow](docs/software-factory.md) · [Stack reference](docs/stack-standard.md)
73
57
 
74
- Apache-2.0. Generated applications are editable source that consumers may customize and license for their products. Retain applicable MIT notices for copied upstream UI source.
58
+ Apache-2.0. Retain the included third-party notices when distributing generated source.
@@ -2,10 +2,10 @@
2
2
  "contractVersion": 1,
3
3
  "owner": "anhedral/platform-contracts/environment",
4
4
  "license": "Apache-2.0",
5
- "sourceRevision": "0050910091dbc653c12118850af31655075f58c3",
5
+ "sourceRevision": "45e3cc484dd22f97344b5954852fa682b593a99a",
6
6
  "files": {
7
7
  "environment-transport.ts": "833b61ecb43c2cbc86c15ed07092ddb364469681d03a23af94e805463c201940",
8
- "environment-file.ts": "29b00c2babab896a6373f93ae5eb2672c00f25862b13b00c20e23a17d2dd83a3",
8
+ "environment-file.ts": "43766ccf3ce52a4a59638bcf3df3fea0d1b8d505bd5a3d694040fb744701f43d",
9
9
  "LICENSE": "6d89bce3e7760469015287d1b6a45d31ef7924475c9b54eabe974bcce373980b"
10
10
  }
11
11
  }
@@ -38,7 +38,7 @@ export function formatResult(_command, value) {
38
38
  if (data.stack === 'anhedral-stack' && !data.generated)
39
39
  return `Foundation preview for ${data.root}.\nStack: Anhedral Stack.\nNo files were written or resources provisioned.`;
40
40
  if (data.stack === 'anhedral-stack' && data.generated)
41
- return `Created ${data.root}.\nStack: Anhedral Stack.\n${data.dependenciesInstalled ? 'Run pnpm dev' : 'Run pnpm install, then pnpm dev'} in the project directory.\nAdd services when needed: anhedral add backend, then anhedral add r2 or anhedral add stripe.\nReview README.md for configuration and deployment.`;
41
+ return `Created ${data.root}.\nStack: Anhedral Stack.\n${data.dependenciesInstalled ? 'Run pnpm dev' : 'Run pnpm install, then pnpm dev'} in the project directory.\nAdd services when needed: anhedral add backend, then anhedral add storage or anhedral add payment.\nReview README.md for configuration and deployment.`;
42
42
  return (`${data.generated ? 'Created' : 'Foundation preview for'} ${data.root}.\nComponents: ${data.products.join(', ')}.\n` +
43
43
  (data.generated
44
44
  ? 'Review README.md, then run pnpm dev in the project directory. You own development, integrations and hosting.'
@@ -472,7 +472,11 @@ export const COMMANDS = {
472
472
  },
473
473
  ],
474
474
  positional: { name: 'capabilities', min: 1, max: 50, kind: 'capability' },
475
- examples: ['add backend', 'add r2', 'add r2 stripe --with-dependencies --dry-run --json'],
475
+ examples: [
476
+ 'add backend',
477
+ 'add storage',
478
+ 'add storage payment --with-dependencies --dry-run --json',
479
+ ],
476
480
  note: 'Adds source and local configuration only. Existing edits are preserved. No provisioning, credential installation, migration or deployment.',
477
481
  },
478
482
  stack: {
@@ -44,13 +44,13 @@ export declare const ANHEDRAL_STACK: {
44
44
  readonly requires: string[];
45
45
  readonly targets: readonly ["apps/api/package.json", "apps/api/wrangler.jsonc", "apps/api/src/index.ts", "apps/api/src/environment.ts", "apps/api/src/capabilities.ts", "apps/api/src/custom-environment.ts", "packages/db/package.json", "packages/db/src/index.ts", "packages/db/src/schema.ts", "apps/api/src/auth.ts", "apps/api/src/auth-features.ts", "apps/api/src/security.ts", "apps/api/src/auth-platform.ts", "apps/api/src/features/auth.ts", "apps/web/src/lib/auth-client.ts"];
46
46
  };
47
- readonly r2: {
47
+ readonly storage: {
48
48
  readonly name: "Private storage";
49
49
  readonly description: "Authenticated, owner-scoped object storage.";
50
50
  readonly requires: readonly ["backend"];
51
51
  readonly targets: readonly ["apps/api/src/features/storage.ts"];
52
52
  };
53
- readonly stripe: {
53
+ readonly payment: {
54
54
  readonly name: "Payments and subscriptions";
55
55
  readonly description: "Stripe subscription and entitlement source.";
56
56
  readonly requires: readonly ["backend"];
@@ -102,13 +102,13 @@ export const ANHEDRAL_STACK = {
102
102
  requires: [],
103
103
  targets: [...CAPABILITIES.hono.targets, ...CAPABILITIES['database-auth'].targets],
104
104
  },
105
- r2: {
105
+ storage: {
106
106
  name: 'Private storage',
107
107
  description: 'Authenticated, owner-scoped object storage.',
108
108
  requires: ['backend'],
109
109
  targets: [...CAPABILITIES.r2.targets],
110
110
  },
111
- stripe: {
111
+ payment: {
112
112
  name: 'Payments and subscriptions',
113
113
  description: 'Stripe subscription and entitlement source.',
114
114
  requires: ['backend'],
@@ -47,8 +47,8 @@ export function readState(e) {
47
47
  }
48
48
  const publicGroups = {
49
49
  backend: ['hono', 'database-auth'],
50
- r2: ['r2'],
51
- stripe: ['stripe'],
50
+ storage: ['r2'],
51
+ payment: ['stripe'],
52
52
  };
53
53
  function publicScopeError(command = 'add') {
54
54
  return commandArgumentError(command, 'The CLI edits only the Anhedral Stack: TanStack Start with OJ and shadcn.');
@@ -128,9 +128,18 @@ function publicStackState(root, state) {
128
128
  export async function runCapabilityCommand(command, args, output, run = execFile) {
129
129
  const parsed = commandArguments(command, args);
130
130
  if (command === 'add') {
131
- const unsupported = parsed.positional.filter((id) => !PUBLIC_STACK_ADDITIONS.includes(id));
132
- if (unsupported.length)
133
- throw commandArgumentError('add', 'Choose backend, r2 or stripe for the Anhedral Stack.');
131
+ const replacements = new Map([
132
+ ['r2', 'storage'],
133
+ ['stripe', 'payment'],
134
+ ['payments', 'payment'],
135
+ ]);
136
+ for (const id of parsed.positional) {
137
+ const replacement = replacements.get(id);
138
+ if (replacement)
139
+ throw commandArgumentError('add', `Use anhedral add ${replacement} instead of anhedral add ${id}.`);
140
+ if (!PUBLIC_STACK_ADDITIONS.includes(id))
141
+ throw commandArgumentError('add', `Choose an Anhedral Stack addition: ${PUBLIC_STACK_ADDITIONS.join(', ')}.`);
142
+ }
134
143
  }
135
144
  let result;
136
145
  if (command === 'stack') {
@@ -174,10 +183,10 @@ export async function runCapabilityCommand(command, args, output, run = execFile
174
183
  if (!parsed.has('--with-dependencies') &&
175
184
  !parsed.positional.includes('backend') &&
176
185
  !(state.installed.includes('hono') && state.installed.includes('database-auth')) &&
177
- parsed.positional.some((id) => id === 'r2' || id === 'stripe'))
186
+ parsed.positional.some((id) => id === 'storage' || id === 'payment'))
178
187
  throw commandArgumentError('add', 'Private storage and payments require backend. Run anhedral add backend first, or explicitly use --with-dependencies.');
179
188
  const requested = [
180
- ...new Set(parsed.positional.flatMap((id) => (id === 'backend' ? ['hono', 'database-auth'] : [id]))),
189
+ ...new Set(parsed.positional.flatMap((id) => publicGroups[id])),
181
190
  ];
182
191
  const additions = capabilityOrder(requested, state.installed, parsed.has('--with-dependencies'));
183
192
  const installed = [...state.installed, ...additions];
@@ -208,9 +217,7 @@ export async function runCapabilityCommand(command, args, output, run = execFile
208
217
  const plan = {
209
218
  root,
210
219
  added: PUBLIC_STACK_ADDITIONS.filter((id) => publicGroups[id].some((capability) => additions.includes(capability))),
211
- alreadyInstalled: parsed.positional.filter((id) => id === 'backend'
212
- ? state.installed.includes('hono') && state.installed.includes('database-auth')
213
- : state.installed.includes(id)),
220
+ alreadyInstalled: parsed.positional.filter((id) => publicGroups[id].every((capability) => state.installed.includes(capability))),
214
221
  installed: PUBLIC_STACK_ADDITIONS.filter((id) => publicGroups[id].every((capability) => installed.includes(capability))),
215
222
  files,
216
223
  configuration: PUBLIC_STACK_ADDITIONS.filter((id) => publicGroups[id].some((capability) => additions.includes(capability))).map((id) => ({
@@ -1,3 +1,6 @@
1
+ export declare const ENVIRONMENT_FILE_MAX_BYTES = 65536;
2
+ export declare class EnvironmentFileError extends Error {
3
+ }
1
4
  /** Literal dotenv parsing only. Never evaluate a shell, interpolate variables,
2
5
  * or include input values in errors. The same parser serves browser and CLI. */
3
6
  export declare function parseEnvironmentFile(input: string): {
@@ -1,18 +1,21 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import { environmentNameSchema } from "./environment-transport.js";
3
+ export const ENVIRONMENT_FILE_MAX_BYTES = 65536;
4
+ export class EnvironmentFileError extends Error {
5
+ }
3
6
  /** Literal dotenv parsing only. Never evaluate a shell, interpolate variables,
4
7
  * or include input values in errors. The same parser serves browser and CLI. */
5
8
  export function parseEnvironmentFile(input) {
6
9
  if (input.includes("\0"))
7
- throw new Error("Environment files cannot contain NUL bytes.");
8
- if (new TextEncoder().encode(input).length > 65536)
9
- throw new Error("Environment files support at most 64 KiB.");
10
+ throw new EnvironmentFileError("Environment files cannot contain NUL bytes.");
11
+ if (new TextEncoder().encode(input).length > ENVIRONMENT_FILE_MAX_BYTES)
12
+ throw new EnvironmentFileError("Environment files support at most 64 KiB.");
10
13
  const text = input.replace(/^\uFEFF/, "").replaceAll("\r\n", "\n");
11
14
  const entries = [];
12
15
  const names = new Set();
13
16
  let position = 0, line = 1;
14
17
  const fail = (message) => {
15
- throw new Error(`Line ${line}: ${message}`);
18
+ throw new EnvironmentFileError(`Line ${line}: ${message}`);
16
19
  };
17
20
  const space = () => {
18
21
  while (text[position] === " " || text[position] === "\t" || text[position] === "\r")
@@ -104,7 +107,7 @@ export function parseEnvironmentFile(input) {
104
107
  }
105
108
  }
106
109
  if (!entries.length)
107
- throw new Error("The environment file contains no variables.");
110
+ throw new EnvironmentFileError("The environment file contains no variables.");
108
111
  return entries;
109
112
  }
110
113
  export function inferredEnvironmentKind(name) {
@@ -26,7 +26,7 @@ export declare const STACK_DEPENDENCIES: {
26
26
  readonly '@types/node': "22.20.5";
27
27
  readonly eslint: "9.39.5";
28
28
  readonly 'drizzle-kit': "0.31.11";
29
- readonly hono: "4.13.13";
29
+ readonly hono: "4.13.18";
30
30
  readonly '@hono/zod-openapi': "1.6.3";
31
31
  readonly fallow: "3.34.0";
32
32
  readonly undici: "7.30.1";
@@ -75,7 +75,7 @@ export const STACK_DEPENDENCIES = {
75
75
  // renovate: datasource=npm depName=drizzle-kit
76
76
  'drizzle-kit': '0.31.11',
77
77
  // renovate: datasource=npm depName=hono
78
- hono: '4.13.13',
78
+ hono: '4.13.18',
79
79
  // renovate: datasource=npm depName=@hono/zod-openapi
80
80
  '@hono/zod-openapi': '1.6.3',
81
81
  // renovate: datasource=npm depName=fallow
package/dist/launch.js CHANGED
@@ -117,9 +117,9 @@ Keep LICENSE.shadcn with the copied starter components.
117
117
  ## Add services progressively
118
118
 
119
119
  Run anhedral add backend to add Hono, Drizzle/D1 and Better Auth together.
120
- Then run anhedral add r2 for private storage, or anhedral add stripe for payments.
120
+ Then run anhedral add storage for private storage, or anhedral add payment for payments.
121
121
  Missing prerequisites stop before writes; --with-dependencies opts into them.
122
- The public additions are backend, r2 and stripe; this application is web-only.
122
+ The public additions are backend, storage and payment; this application is web-only.
123
123
 
124
124
  After adding backend, copy apps/api/.dev.vars.example to apps/api/.dev.vars.
125
125
  Set PUBLIC_APP_URL=http://localhost:3000 and generate BETTER_AUTH_SECRET with
@@ -150,7 +150,7 @@ requires its separately reviewed Anhedral Stack runtime/artifact; generation is
150
150
  put(root, 'AGENTS.md', `# Anhedral Stack application
151
151
 
152
152
  Use the single Anhedral Stack, starting with TanStack Start and source-owned shadcn UI. Add backend for Hono,
153
- Drizzle/D1 and Better Auth together. Add r2 and stripe only when required. Mobile,
153
+ Drizzle/D1 and Better Auth together. Use the storage and payment additions only when required. Mobile,
154
154
  extensions and desktop are outside launch scope.
155
155
 
156
156
  Edit web product routes in apps/web/src/routes, API routes in apps/api/src/index.ts,
@@ -4,7 +4,7 @@ import { dirname, join, resolve } from 'node:path';
4
4
  import { z } from 'zod';
5
5
  import { commandArgumentError, commandArguments } from '../cli-arguments.js';
6
6
  import { createReporter } from '../cli-output.js';
7
- import { inferredEnvironmentKind, parseEnvironmentFile } from '../contracts/environment-file.js';
7
+ import { ENVIRONMENT_FILE_MAX_BYTES, inferredEnvironmentKind, parseEnvironmentFile, } from '../contracts/environment-file.js';
8
8
  import { environmentImportReceiptSchema, environmentImportSchema, environmentMetadataSchema, environmentNameSchema, projectEnvironmentSchema, } from '../contracts/environment-transport.js';
9
9
  import { platformFailure, readPrivate, writePrivate } from './state.js';
10
10
  const planSchema = z
@@ -41,11 +41,11 @@ export function readEnvironmentSecret(file) {
41
41
  try {
42
42
  const info = fstatSync(descriptor);
43
43
  if (!info.isFile() ||
44
- info.size > 65536 ||
44
+ info.size > ENVIRONMENT_FILE_MAX_BYTES ||
45
45
  (process.platform !== 'win32' &&
46
46
  (info.uid !== process.getuid?.() || (info.mode & 0o077) !== 0)))
47
47
  throw platformFailure('Environment input must be your regular owner-only file (mode 0600), at most 64 KiB.');
48
- const data = Buffer.alloc(65537);
48
+ const data = Buffer.alloc(ENVIRONMENT_FILE_MAX_BYTES + 1);
49
49
  let length = 0;
50
50
  while (length < data.length) {
51
51
  const read = readSync(descriptor, data, length, data.length - length, null);
@@ -53,7 +53,7 @@ export function readEnvironmentSecret(file) {
53
53
  break;
54
54
  length += read;
55
55
  }
56
- if (length > 65536)
56
+ if (length > ENVIRONMENT_FILE_MAX_BYTES)
57
57
  throw platformFailure('Environment input exceeds 64 KiB.');
58
58
  return data.subarray(0, length);
59
59
  }
@@ -71,7 +71,7 @@ async function stdinBytes() {
71
71
  for await (const item of process.stdin) {
72
72
  const bytes = Buffer.from(item);
73
73
  length += bytes.length;
74
- if (length > 65536)
74
+ if (length > ENVIRONMENT_FILE_MAX_BYTES)
75
75
  throw platformFailure('Environment input exceeds 64 KiB.');
76
76
  chunks.push(bytes);
77
77
  }
@@ -129,7 +129,7 @@ export async function runEnvironmentCommand(args, output, context, request, read
129
129
  const bytes = options.has('--file')
130
130
  ? readEnvironmentSecret(options.value('--file'))
131
131
  : await readInput();
132
- if (bytes.length > 65536)
132
+ if (bytes.length > ENVIRONMENT_FILE_MAX_BYTES)
133
133
  throw new Error('Environment input exceeds 64 KiB.');
134
134
  const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
135
135
  entries = operation === 'set' ? [{ name: name, value: text }] : parseEnvironmentFile(text);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const GENERATOR_VERSION = "0.22.1";
1
+ export declare const GENERATOR_VERSION = "0.23.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const GENERATOR_VERSION = '0.22.1';
1
+ export const GENERATOR_VERSION = '0.23.0';
@@ -7,15 +7,17 @@ anhedral init my-app
7
7
  cd my-app
8
8
  anhedral add backend --dry-run --json
9
9
  anhedral add backend
10
- anhedral add r2 stripe
10
+ anhedral add storage payment
11
11
  anhedral stack status --json
12
12
  ```
13
13
 
14
- | Selection | Source added | Requires |
15
- | --------- | ----------------------------------------------------------------------- | ----------------------------- |
16
- | `backend` | Hono API, Drizzle/D1, Better Auth and web sign-in starter | Anhedral Stack web foundation |
17
- | `r2` | Private storage binding and authenticated owner-scoped file routes | `backend` |
18
- | `stripe` | Subscription Checkout, signed webhooks and canonical entitlement checks | `backend` |
14
+ | Selection | Source added | Requires |
15
+ | --------- | ----------------------------------------------------------------- | ----------------------------- |
16
+ | `backend` | Hono API, Drizzle/D1, Better Auth and web sign-in starter | Anhedral Stack web foundation |
17
+ | `storage` | Cloudflare R2 binding and authenticated owner-scoped file routes | `backend` |
18
+ | `payment` | Stripe Checkout, signed webhooks and canonical entitlement checks | `backend` |
19
+
20
+ Use `add storage` in place of `add r2`, and `add payment` in place of `add stripe` or `add payments`. Existing projects retain the provider identifiers `r2` and `stripe` in their source manifests. The CLI recognizes these as installed storage and payment additions.
19
21
 
20
22
  `backend` is one public selection; its provenance records the concrete Hono and database/auth capabilities. Use `--with-dependencies` to include missing prerequisites in the same planned source transaction. `stack list` describes this stack's additions. `status`/`doctor` check source completeness, not live service activation.
21
23
 
@@ -220,6 +220,10 @@ routing require `deploy plan --manifest <file> --new`. Plan/source expiry and
220
220
  revocation fail closed. State under `.anhedral/platform/deployment.json` contains
221
221
  no credentials and cannot select a network origin or change the signed-in identity.
222
222
 
223
+ The CLI imports the reviewed portable environment parser from Platform. File, stdin
224
+ and parser size limits share its exported constant; typed parser errors retain the
225
+ same value-free validation messages.
226
+
223
227
  `env list` returns names, types, environments and versions. `env import --environment
224
228
  staging|production --file <path>` reads a private dotenv file; `--stdin` accepts a
225
229
  pipe. `env set <NAME>` reads one literal value from a file or pipe. Values are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anhedral",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "description": "The open-source Anhedral API client for building, configuring and deploying apps, with editable source generation.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -109,14 +109,14 @@
109
109
  "packageManager": "pnpm@10.34.5",
110
110
  "devDependencies": {
111
111
  "@types/node": "20.19.43",
112
- "hono": "4.13.13",
113
- "prettier": "3.9.10",
114
- "typescript": "5.9.3"
112
+ "hono": "4.13.18",
113
+ "prettier": "3.10.1",
114
+ "typescript": "6.0.3"
115
115
  },
116
116
  "dependencies": {
117
117
  "jsonc-parser": "3.3.1",
118
118
  "yaml": "2.9.1",
119
- "zod": "4.6.6",
119
+ "zod": "4.6.7",
120
120
  "ignore": "7.0.14"
121
121
  }
122
122
  }