@symplek/cli 0.0.0-stage → 0.2.0-beta.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/CHANGELOG.md +47 -0
- package/LICENSE +21 -0
- package/README.md +74 -2
- package/bin/symplek.js +5 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +44 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +36 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +467 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/generate.d.ts +26 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +491 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +46 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +350 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/migrate.d.ts +41 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +518 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/validate.d.ts +252 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +515 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +24 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +39 -0
- package/dist/models.js.map +1 -0
- package/dist/naming.d.ts +20 -0
- package/dist/naming.d.ts.map +1 -0
- package/dist/naming.js +48 -0
- package/dist/naming.js.map +1 -0
- package/dist/templates/agent/agent.ts.template +41 -0
- package/dist/templates/agent/general.yaml.template +34 -0
- package/dist/templates/agent/researcher.yaml.template +42 -0
- package/dist/templates/agent/reviewer.yaml.template +51 -0
- package/dist/templates/project/full/.github/workflows/ci.yml.template +34 -0
- package/dist/templates/project/full/.gitignore.template +6 -0
- package/dist/templates/project/full/Dockerfile.template +43 -0
- package/dist/templates/project/full/README.md.template +77 -0
- package/dist/templates/project/full/agents/example.yaml.template +16 -0
- package/dist/templates/project/full/package.json.template +30 -0
- package/dist/templates/project/full/src/index.ts.template +43 -0
- package/dist/templates/project/full/src/symplek.config.ts.template +20 -0
- package/dist/templates/project/full/src/tools/index.ts.template +73 -0
- package/dist/templates/project/full/tests/example.test.ts.template +49 -0
- package/dist/templates/project/full/tsconfig.json.template +18 -0
- package/dist/templates/project/minimal/.gitignore.template +6 -0
- package/dist/templates/project/minimal/agents/example.yaml.template +16 -0
- package/dist/templates/project/minimal/package.json.template +27 -0
- package/dist/templates/project/minimal/src/index.ts.template +43 -0
- package/dist/templates/project/minimal/src/symplek.config.ts.template +20 -0
- package/dist/templates/project/minimal/tsconfig.json.template +18 -0
- package/dist/templates/project/standard/.gitignore.template +6 -0
- package/dist/templates/project/standard/README.md.template +77 -0
- package/dist/templates/project/standard/agents/example.yaml.template +16 -0
- package/dist/templates/project/standard/package.json.template +30 -0
- package/dist/templates/project/standard/src/index.ts.template +43 -0
- package/dist/templates/project/standard/src/symplek.config.ts.template +20 -0
- package/dist/templates/project/standard/src/tools/index.ts.template +73 -0
- package/dist/templates/project/standard/tests/example.test.ts.template +49 -0
- package/dist/templates/project/standard/tsconfig.json.template +18 -0
- package/dist/utils/templates.d.ts +41 -0
- package/dist/utils/templates.d.ts.map +1 -0
- package/dist/utils/templates.js +133 -0
- package/dist/utils/templates.js.map +1 -0
- package/package.json +60 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 91ca43f: First public beta of the CLI. Its `create` wrapper is versioned alongside it and held back from npm.
|
|
8
|
+
|
|
9
|
+
**@symplek/cli**
|
|
10
|
+
- The code generators emit TypeScript that compiles against the real `@symplek/core` API. A compile gate in the test suite type-checks every generator path.
|
|
11
|
+
- Requires Node `>=20.19`, the lowest version the package can start on.
|
|
12
|
+
- `@symplek/core` is declared as a peer dependency, since generated code imports it.
|
|
13
|
+
- `symplek init` no longer hangs while the package manager installs.
|
|
14
|
+
- The binary resolves on case-sensitive filesystems (`symplek`, lowercase).
|
|
15
|
+
- `symplek --version` reports the real package version.
|
|
16
|
+
- The default project name is `my-symplek-project`, which passes the CLI's own name check in `--yes` mode.
|
|
17
|
+
- YAML generation validates its inputs and escapes template values.
|
|
18
|
+
- Every agent file the CLI scaffolds passes the CLI's own `validate` and `generate`. The templates used keys the validator rejected.
|
|
19
|
+
- `validate` and `generate` accept any well-formed model id. The CLI no longer keeps its own list of which models exist, so a model released after the CLI still works.
|
|
20
|
+
- `symplek add agent --type` is checked against the real list of types. The `typescript` type writes a TypeScript agent and no YAML file; it used to write TypeScript into the YAML file.
|
|
21
|
+
- The test `symplek add agent` writes into your project runs your real agent and replaces only the model call. The old one mocked the agent and tested the mock.
|
|
22
|
+
- Scaffolded projects depend on `zod` and on the CLI that created them, so `symplek generate` runs from inside the project.
|
|
23
|
+
|
|
24
|
+
**create-symplek**
|
|
25
|
+
- New package, not published in this release. The name `create-weft` belongs to someone else on npm, so the package is named `create-symplek` and stays marked private until a publishing decision is made.
|
|
26
|
+
- A thin wrapper that runs `symplek init` from the `@symplek/cli` it depends on, started with the running Node binary and no shell, so it behaves the same on Windows, macOS and Linux. Its version is linked to `@symplek/cli`'s, so the two are bumped to the same number whenever they are released together.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [91ca43f]
|
|
31
|
+
- @symplek/core@1.0.0-beta.2
|
|
32
|
+
|
|
33
|
+
All notable changes to this project will be documented in this file.
|
|
34
|
+
|
|
35
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
36
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
37
|
+
|
|
38
|
+
## [Unreleased]
|
|
39
|
+
|
|
40
|
+
## [0.1.0] - 2026-XX-XX
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- Initial release. `weft init` scaffolds minimal, standard, and full project templates.
|
|
45
|
+
|
|
46
|
+
[Unreleased]: https://github.com/wefthq/weft/compare/weft-cli@0.1.0...HEAD
|
|
47
|
+
[0.1.0]: https://github.com/wefthq/weft/releases/tag/weft-cli@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Symplek Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,75 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @symplek/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Symplek CLI - AI Agent Development Toolkit
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Global install
|
|
9
|
+
npm install -g @symplek/cli
|
|
10
|
+
|
|
11
|
+
# Or use npx
|
|
12
|
+
npx @symplek/cli --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Display help
|
|
19
|
+
symplek --help
|
|
20
|
+
|
|
21
|
+
# Display version
|
|
22
|
+
symplek --version
|
|
23
|
+
|
|
24
|
+
# Initialize a new Symplek project
|
|
25
|
+
symplek init
|
|
26
|
+
|
|
27
|
+
# Add agents, tools, or workflows
|
|
28
|
+
symplek add agent my-agent
|
|
29
|
+
|
|
30
|
+
# Validate YAML agent definitions
|
|
31
|
+
symplek validate agents/
|
|
32
|
+
|
|
33
|
+
# Migrate existing agent definitions
|
|
34
|
+
symplek migrate
|
|
35
|
+
|
|
36
|
+
# Generate TypeScript from YAML
|
|
37
|
+
symplek generate
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
| Command | Description | Status |
|
|
43
|
+
|---------|-------------|--------|
|
|
44
|
+
| `symplek --help` | Display help information | ✅ Available |
|
|
45
|
+
| `symplek --version` | Display CLI version | ✅ Available |
|
|
46
|
+
| `symplek init` | Initialize a new Symplek project | ✅ Available |
|
|
47
|
+
| `symplek add` | Add agents, tools, or workflows | ✅ Available |
|
|
48
|
+
| `symplek validate` | Validate YAML definitions | ✅ Available |
|
|
49
|
+
| `symplek migrate` | Migrate existing agent definitions | ✅ Available |
|
|
50
|
+
| `symplek generate` | Generate TypeScript from YAML | ✅ Available |
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- Node.js >= 20.19
|
|
55
|
+
- npm, pnpm, yarn, or bun
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Build the CLI
|
|
61
|
+
pnpm build
|
|
62
|
+
|
|
63
|
+
# Watch mode
|
|
64
|
+
pnpm dev
|
|
65
|
+
|
|
66
|
+
# Run tests
|
|
67
|
+
pnpm test
|
|
68
|
+
|
|
69
|
+
# Type check
|
|
70
|
+
pnpm typecheck
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|
package/bin/symplek.js
ADDED
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/**
|
|
5
|
+
* @fileoverview CLI entry point for @symplek/cli.
|
|
6
|
+
* @description This file IS the executable (`bin` in package.json).
|
|
7
|
+
* It calls program.parse() — it should NEVER be imported as a library.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ CRITICAL: This file calls process.exit(). Do NOT import it.
|
|
10
|
+
* For programmatic use, import from "@symplek/cli" which provides only
|
|
11
|
+
* the library exports (no side effects, no process.exit).
|
|
12
|
+
*
|
|
13
|
+
* @module @symplek/cli/cli
|
|
14
|
+
* @since 1.0.0-beta.2 — Split from index.ts (FATAL #5 fix, 2026-07-07)
|
|
15
|
+
*/
|
|
16
|
+
const commander_1 = require("commander");
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
18
|
+
const { version } = require("../package.json");
|
|
19
|
+
const program = new commander_1.Command();
|
|
20
|
+
program
|
|
21
|
+
.name("symplek")
|
|
22
|
+
.description("Symplek CLI - AI Agent Development Toolkit")
|
|
23
|
+
.version(version)
|
|
24
|
+
.showHelpAfterError(true)
|
|
25
|
+
.showSuggestionAfterError(true);
|
|
26
|
+
const add_js_1 = require("./commands/add.js");
|
|
27
|
+
const generate_js_1 = require("./commands/generate.js");
|
|
28
|
+
const init_js_1 = require("./commands/init.js");
|
|
29
|
+
const migrate_js_1 = require("./commands/migrate.js");
|
|
30
|
+
const validate_js_1 = require("./commands/validate.js");
|
|
31
|
+
program.addCommand((0, init_js_1.initCommand)());
|
|
32
|
+
program.addCommand((0, add_js_1.createAddCommand)());
|
|
33
|
+
program.addCommand((0, validate_js_1.validateCommand)());
|
|
34
|
+
program.addCommand((0, migrate_js_1.migrateCommand)());
|
|
35
|
+
program.addCommand((0, generate_js_1.generateCommand)());
|
|
36
|
+
// Handle unknown commands
|
|
37
|
+
program.on("command:*", (operands) => {
|
|
38
|
+
console.error(`error: unknown command '${operands[0]}'`);
|
|
39
|
+
console.error();
|
|
40
|
+
program.outputHelp();
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
program.parse();
|
|
44
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;;GAWG;AACH,yCAAoC;AAEpC,iEAAiE;AACjE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,4CAA4C,CAAC;KACzD,OAAO,CAAC,OAAO,CAAC;KAChB,kBAAkB,CAAC,IAAI,CAAC;KACxB,wBAAwB,CAAC,IAAI,CAAC,CAAC;AAElC,8CAAqD;AACrD,wDAAyD;AACzD,gDAAiD;AACjD,sDAAuD;AACvD,wDAAyD;AAEzD,OAAO,CAAC,UAAU,CAAC,IAAA,qBAAW,GAAE,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,IAAA,yBAAgB,GAAE,CAAC,CAAC;AACvC,OAAO,CAAC,UAAU,CAAC,IAAA,6BAAe,GAAE,CAAC,CAAC;AACtC,OAAO,CAAC,UAAU,CAAC,IAAA,2BAAc,GAAE,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,IAAA,6BAAe,GAAE,CAAC,CAAC;AAEtC,0BAA0B;AAC1B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE;IACnC,OAAO,CAAC,KAAK,CAAC,2BAA2B,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzD,OAAO,CAAC,KAAK,EAAE,CAAC;IAChB,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `symplek add` command - scaffolds new components
|
|
3
|
+
* Supports: agent (more types coming in future stories)
|
|
4
|
+
*/
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import { type AgentType } from "../utils/templates.js";
|
|
7
|
+
export { kebabToCamel } from "../naming.js";
|
|
8
|
+
/**
|
|
9
|
+
* True when `name` can be used as an agent name: kebab-case, and not a word
|
|
10
|
+
* that would make the exported function unparseable.
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateAgentName(name: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Generate YAML content for an agent
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateAgentYaml(name: string, options: {
|
|
17
|
+
type: AgentType | "custom";
|
|
18
|
+
model: string;
|
|
19
|
+
tools?: string[];
|
|
20
|
+
}): string;
|
|
21
|
+
/**
|
|
22
|
+
* Generate TypeScript content for an agent
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateAgentTypeScript(name: string, options: {
|
|
25
|
+
model: string;
|
|
26
|
+
tools?: string[];
|
|
27
|
+
}): string;
|
|
28
|
+
/**
|
|
29
|
+
* Generate test file content for an agent
|
|
30
|
+
*/
|
|
31
|
+
export declare function generateAgentTest(name: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Create the add command with subcommands
|
|
34
|
+
*/
|
|
35
|
+
export declare function createAddCommand(): Command;
|
|
36
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,uBAAuB,CAAC;AAsC/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAiBD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACP,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,GACA,MAAM,CAiDR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,GACA,MAAM,CAQR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+CtD;AAmFD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CA0R1C"}
|