@companyhelm/cli 0.0.2 → 0.0.6

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.
Files changed (47) hide show
  1. package/README.md +24 -62
  2. package/RUNTIME_IMAGE_VERSION +1 -1
  3. package/dist/cli.js +29 -1
  4. package/dist/commands/register-commands.js +2 -0
  5. package/dist/commands/root.js +341 -20
  6. package/dist/commands/startup.js +138 -55
  7. package/dist/commands/status.js +32 -0
  8. package/dist/service/app_server.js +23 -9
  9. package/dist/service/docker/app_server_container.js +3 -1
  10. package/dist/service/thread_lifecycle.js +4 -1
  11. package/dist/state/daemon_state.js +83 -0
  12. package/dist/state/schema.js +9 -1
  13. package/dist/templates/app_server_bootstrap.sh.j2 +46 -0
  14. package/dist/templates/runtime_agents.md.j2 +50 -0
  15. package/dist/templates/runtime_bashrc.j2 +19 -0
  16. package/dist/utils/daemon.js +15 -0
  17. package/dist/utils/process.js +22 -0
  18. package/drizzle/0011_actual_lucky.sql +7 -0
  19. package/drizzle/meta/_journal.json +8 -1
  20. package/package.json +7 -3
  21. package/dist/commands/agent/index.js +0 -10
  22. package/dist/commands/agent/list.js +0 -31
  23. package/dist/commands/agent/register-agent-commands.js +0 -10
  24. package/dist/commands/index.js +0 -15
  25. package/dist/commands/sdk/index.js +0 -12
  26. package/dist/commands/thread/index.js +0 -12
  27. package/dist/config/local.js +0 -1
  28. package/dist/config/schema.js +0 -7
  29. package/dist/model.js +0 -22
  30. package/dist/schema.js +0 -47
  31. package/dist/service/docker/docker_provider.js +0 -1
  32. package/dist/service/docker/runtime_container.js +0 -1
  33. package/dist/service/docker/runtime_image.js +0 -40
  34. package/dist/startup.js +0 -166
  35. package/dist/state/service/app_server.js +0 -392
  36. package/dist/state/service/buffered_client_message_sender.js +0 -73
  37. package/dist/state/service/companyhelm_api_client.js +0 -316
  38. package/dist/state/service/docker/app_server_container.js +0 -165
  39. package/dist/state/service/docker/dind.js +0 -114
  40. package/dist/state/service/docker/runtime_app_server_exec.js +0 -95
  41. package/dist/state/service/host.js +0 -15
  42. package/dist/state/service/runtime_shell.js +0 -23
  43. package/dist/state/service/sdk/refresh_models.js +0 -83
  44. package/dist/state/service/thread_lifecycle.js +0 -327
  45. package/dist/state/service/thread_runtime.js +0 -11
  46. package/dist/state/service/thread_turn_state.js +0 -45
  47. package/dist/state/service/workspace_agents.js +0 -115
package/README.md CHANGED
@@ -1,95 +1,57 @@
1
- # CompanyHelm Runner
1
+ # CompanyHelm CLI
2
2
 
3
- Run coding agents in yolo mode inside secure Docker containers, locally.
4
-
5
- Features:
6
-
7
- - Secure agent containers: no risk of agents going rogue on your main file system
8
- - Yolo mode: no more permission prompts
9
- - DinD (Docker-in-Docker): allows agents to spin up your services (backend, frontend, etc.) and test end-to-end
10
- - Multi-agent support: each agent gets its own environment and can operate autonomously
11
-
12
- ---
13
-
14
- ## Why CompanyHelm Runner?
15
-
16
- Modern coding agents are powerful, but they often run directly on your machine.
17
-
18
- CompanyHelm Runner adds:
19
-
20
- - Isolation
21
- - Docker-in-Docker (DIND)
22
- - Clean workspace lifecycle
23
-
24
- Think:
25
-
26
- Codex or Claude Code, but inside a sandbox you control.
27
-
28
- ---
3
+ Run coding agents in isolated Docker sandboxes on your machine.
29
4
 
30
5
  ## Install
31
6
 
32
7
  ```bash
33
- npm install -g companyhelm
8
+ npm install -g @companyhelm/cli
34
9
  ```
35
10
 
36
- Or run directly:
11
+ Or run it without installing globally:
37
12
 
38
13
  ```bash
39
- npx companyhelm
14
+ npx @companyhelm/cli --help
40
15
  ```
41
16
 
42
- ---
17
+ Package: [@companyhelm/cli](https://www.npmjs.com/package/@companyhelm/cli)
43
18
 
44
- ## Quick Start
19
+ ## Basic Usage
45
20
 
46
- Run companyhelm runner inside your workspace:
21
+ Start the CLI in the foreground:
47
22
 
48
23
  ```bash
49
- companyhelm
24
+ companyhelm-runner
50
25
  ```
51
26
 
52
- ## Database Migrations (Drizzle Kit)
53
-
54
- Generate SQL migrations from the schema:
55
-
56
- ```bash
57
- npm run db:generate
58
- ```
59
-
60
- Apply migrations directly with Drizzle Kit (defaults to `~/.local/share/companyhelm/state.db`):
27
+ Start it as a daemon:
61
28
 
62
29
  ```bash
63
- npm run db:migrate
30
+ companyhelm-runner --daemon
64
31
  ```
65
32
 
66
- Override the migration target database path when needed:
33
+ Check whether the daemon is running:
67
34
 
68
35
  ```bash
69
- DRIZZLE_DB_PATH=/absolute/path/to/state.db npm run db:migrate
36
+ companyhelm-runner status
70
37
  ```
71
38
 
72
- ## Thread-Level MCP E2E Check
39
+ The `status` command prints:
73
40
 
74
- Use the runtime helper to validate thread-level MCP end-to-end behavior for:
41
+ - whether the daemon is running
42
+ - the recorded daemon PID
43
+ - the daemon log directory and log file path
75
44
 
76
- - a local known-good stdio MCP server (`local_echo`)
77
- - Context7 stdio MCP (`resolve-library-id`, `query-docs`)
45
+ ## Why Use It
78
46
 
79
- Prerequisites:
80
-
81
- - CompanyHelm API is running and reachable at `http://127.0.0.1:4000/graphql` (or pass `--api-url`)
82
- - at least one connected runner for the target company with `codex` SDK and an available model
83
-
84
- Run:
85
-
86
- ```bash
87
- scripts/runtime/e2e-thread-mcp --company-id <company-id>
88
- ```
47
+ - Runs agents in isolated containers instead of directly on your machine
48
+ - Supports Docker-in-Docker for end-to-end workflows
49
+ - Keeps runner state in a local SQLite database
50
+ - Supports long-running daemon mode for background operation
89
51
 
90
- The script exits non-zero on failed assertions and prints a JSON summary on success, including created MCP/agent/thread IDs.
52
+ ## For Developers
91
53
 
92
- ---
54
+ Development and maintenance notes live in [DEVELOPING.md](./DEVELOPING.md).
93
55
 
94
56
  ## License
95
57
 
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
package/dist/cli.js CHANGED
@@ -21,4 +21,32 @@ program
21
21
  .description("Run coding agents in fully isolated Docker sandboxes, locally.")
22
22
  .version(getVersion());
23
23
  (0, register_commands_js_1.registerCommands)(program);
24
- program.parse(process.argv);
24
+ function formatCliError(error) {
25
+ if (error instanceof commander_1.CommanderError) {
26
+ return {
27
+ message: error.message,
28
+ exitCode: error.exitCode,
29
+ };
30
+ }
31
+ if (error instanceof Error) {
32
+ return {
33
+ message: error.message,
34
+ exitCode: 1,
35
+ };
36
+ }
37
+ return {
38
+ message: String(error),
39
+ exitCode: 1,
40
+ };
41
+ }
42
+ async function main() {
43
+ try {
44
+ await program.parseAsync(process.argv);
45
+ }
46
+ catch (error) {
47
+ const { message, exitCode } = formatCliError(error);
48
+ process.stderr.write(`${message}\n`);
49
+ process.exitCode = exitCode;
50
+ }
51
+ }
52
+ void main();
@@ -4,9 +4,11 @@ exports.registerCommands = registerCommands;
4
4
  const root_js_1 = require("./root.js");
5
5
  const shell_js_1 = require("./shell.js");
6
6
  const register_sdk_commands_js_1 = require("./sdk/register-sdk-commands.js");
7
+ const status_js_1 = require("./status.js");
7
8
  const register_thread_commands_js_1 = require("./thread/register-thread-commands.js");
8
9
  function registerCommands(program) {
9
10
  (0, root_js_1.registerRootCommand)(program);
11
+ (0, status_js_1.registerStatusCommand)(program);
10
12
  (0, register_thread_commands_js_1.registerThreadCommands)(program);
11
13
  (0, shell_js_1.registerShellCommand)(program);
12
14
  (0, register_sdk_commands_js_1.registerSdkCommands)(program);