@danalexilewis/taskgraph 0.1.0 → 0.1.1

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
@@ -12,18 +12,35 @@ TaskGraph is a small CLI (`tg`) + Dolt-backed schema for managing **plans, tasks
12
12
 
13
13
  ## Quick start
14
14
 
15
- 1. Install Dolt (`brew install dolt`)
16
- 2. Initialize TaskGraph in your repo:
15
+ 1. **Install Dolt** (required for the local DB): `brew install dolt`
16
+ 2. **Install TaskGraph** in your repo:
17
17
 
18
- ```bash
19
- tg init
20
- ```
18
+ ```bash
19
+ pnpm add -D @danalexilewis/taskgraph
20
+ ```
21
21
 
22
- 1. Scaffold recommended conventions (example domain docs, skill guides, and Cursor rules):
22
+ 3. **Register the command** in your repo so `tg` runs the installed CLI. In `package.json`, add a script:
23
23
 
24
- ```bash
25
- tg setup
26
- ```
24
+ ```json
25
+ "scripts": {
26
+ "tg": "tg"
27
+ }
28
+ ```
29
+
30
+ Then use `pnpm tg` (or `npm run tg`) for all commands; the script runs the binary from `node_modules/.bin`.
31
+ 4. **Initialize** from your repo root (creates `.taskgraph/` and Dolt DB):
32
+
33
+ ```bash
34
+ pnpm tg init
35
+ ```
36
+
37
+ 5. **Scaffold** (optional; domain docs, skill guides, Cursor rules):
38
+
39
+ ```bash
40
+ pnpm tg setup
41
+ ```
42
+
43
+ Without the script, the shell can't find `tg`; `npx tg init` also works if you prefer not to add the script.
27
44
 
28
45
  ## Conventions (domain + skill guides)
29
46
 
@@ -33,15 +50,3 @@ Tasks can optionally declare:
33
50
  - `skill`: slug(s) that map to `docs/skills/<skill>.md`
34
51
 
35
52
  Agents can read the docs printed by `tg context <taskId>` to load repo-specific conventions before making changes.
36
-
37
- ## Publishing the CLI to npm
38
-
39
- The repo root is the publishable package. **Run from the repo root**:
40
-
41
- 1. **Package name**: The name `taskgraph` is available. If it were taken, use a scoped name in `package.json` (e.g. `@yourname/taskgraph`).
42
- 2. **Build**: `pnpm build`
43
- 3. **Dry-run** (see what will be in the tarball): `npm pack --dry-run`
44
- 4. **Publish**: `npm publish`
45
- (Requires `npm login` and 2FA if enabled.)
46
-
47
- The `prepublishOnly` script runs `npm run build` when you publish, so `dist/` is built before packing. The tarball includes only `dist`, `templates`, and `README.md` (see `files` in package.json).
package/dist/cli/index.js CHANGED
File without changes
package/dist/cli/init.js CHANGED
@@ -43,6 +43,18 @@ const neverthrow_1 = require("neverthrow");
43
43
  const errors_1 = require("../domain/errors");
44
44
  const TASKGRAPH_DIR = ".taskgraph";
45
45
  const CONFIG_FILE = path.join(TASKGRAPH_DIR, "config.json");
46
+ /** Build a user-friendly hint when init fails (e.g. dolt not found). */
47
+ function initFailureHint(cause) {
48
+ if (cause instanceof Error) {
49
+ const code = cause.code;
50
+ const msg = cause.message ?? String(cause);
51
+ if (code === "ENOENT" || /not found|command not found/i.test(msg)) {
52
+ return " Dolt may not be installed or not on PATH. Install it (e.g. brew install dolt) and ensure you run tg from your repo (e.g. npx tg init or pnpm exec tg init).";
53
+ }
54
+ return ` Cause: ${msg}`;
55
+ }
56
+ return ` Cause: ${String(cause)}`;
57
+ }
46
58
  function initCommand(program) {
47
59
  program
48
60
  .command("init")
@@ -91,7 +103,10 @@ function initCommand(program) {
91
103
  // ... rest of the match block remains the same
92
104
  }, (error) => {
93
105
  const appError = error;
94
- console.error(`Error initializing Task Graph: ${appError.message}`); // Used appError.message
106
+ console.error(`Error initializing Task Graph: ${appError.message}`);
107
+ if (!cmd.parent?.opts().json && appError.cause != null) {
108
+ console.error(initFailureHint(appError.cause));
109
+ }
95
110
  if (cmd.parent?.opts().json) {
96
111
  console.log(JSON.stringify({
97
112
  status: "error",
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "@danalexilewis/taskgraph",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Task Graph CLI for Centaur Development",
5
5
  "main": "dist/cli/index.js",
6
6
  "bin": {
7
7
  "tg": "dist/cli/index.js"
8
8
  },
9
- "files": ["dist", "README.md"],
10
- "scripts": {
11
- "tg": "node dist/cli/index.js",
12
- "dev": "tsx src/cli/index.ts",
13
- "build": "tsc && node -e \"require('fs').cpSync('src/template','dist/template',{recursive:true})\"",
14
- "prepublishOnly": "npm run build",
15
- "start": "node dist/cli/index.js",
16
- "test": "vitest run --dir __tests__",
17
- "test:e2e": "vitest run --dir __tests__/e2e",
18
- "test:integration": "vitest run --dir __tests__/integration"
19
- },
20
- "keywords": ["cli", "tasks", "plans", "dolt", "cursor", "centaur", "taskgraph", "agent-workflow"],
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "keywords": [
14
+ "cli",
15
+ "tasks",
16
+ "plans",
17
+ "dolt",
18
+ "cursor",
19
+ "centaur",
20
+ "taskgraph",
21
+ "agent-workflow"
22
+ ],
21
23
  "author": "danalexilewis",
22
24
  "license": "MIT",
23
25
  "engines": {
@@ -43,5 +45,14 @@
43
45
  "tsx": "^4.7.1",
44
46
  "typescript": "^5.3.3",
45
47
  "vitest": "^1.0.0"
48
+ },
49
+ "scripts": {
50
+ "tg": "node dist/cli/index.js",
51
+ "dev": "tsx src/cli/index.ts",
52
+ "build": "tsc && node -e \"require('fs').cpSync('src/template','dist/template',{recursive:true})\"",
53
+ "start": "node dist/cli/index.js",
54
+ "test": "vitest run --dir __tests__",
55
+ "test:e2e": "vitest run --dir __tests__/e2e",
56
+ "test:integration": "vitest run --dir __tests__/integration"
46
57
  }
47
- }
58
+ }