Skip to content

Commit 40ae537

Browse files
committed
cp dines
1 parent 0c39e2b commit 40ae537

6 files changed

Lines changed: 59 additions & 40 deletions

File tree

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

.husky/pre-push

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# Pre-push hook to ensure command docs are up to date
5+
# This hook runs docs:commands and fails if README.md needs to be committed
6+
7+
echo "Running docs:commands to ensure README.md is up to date..."
8+
9+
# Run the docs generation script
10+
npm run docs:commands
11+
12+
# Check if README.md has uncommitted changes
13+
if ! git diff --quiet README.md; then
14+
echo ""
15+
echo "❌ README.md has uncommitted changes after running docs:commands"
16+
echo " Please commit the updated README.md before pushing:"
17+
echo ""
18+
echo " git add README.md"
19+
echo " git commit -m 'docs: update command structure'"
20+
echo ""
21+
exit 1
22+
fi
23+
24+
# Check if README.md has staged but uncommitted changes
25+
if ! git diff --cached --quiet README.md 2>/dev/null; then
26+
echo ""
27+
echo "⚠️ README.md has staged changes that need to be committed"
28+
echo " Please commit the staged README.md before pushing"
29+
echo ""
30+
exit 1
31+
fi
32+
33+
echo "✅ README.md is up to date"
34+
exit 0

README.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -119,42 +119,6 @@ rli mcp start # Start the MCP server
119119
rli mcp install # Install Runloop MCP server configurat...
120120
```
121121

122-
### Output Format
123-
124-
All commands support the `--output` (or `-o`) parameter to control the output format. This is especially useful for scripting and automation:
125-
126-
```bash
127-
# Output as JSON (default for list commands)
128-
rli devbox list --output json
129-
rli devbox list -o json
130-
131-
# Output as YAML
132-
rli devbox get <id> --output yaml
133-
rli devbox get <id> -o yaml
134-
135-
# Output as text (default for single item commands)
136-
rli devbox get <id> --output text
137-
rli devbox get <id> -o text
138-
```
139-
140-
**Supported formats:**
141-
142-
- `text` - Human-readable key-value pairs (default for single items)
143-
- `json` - JSON format (default for list commands)
144-
- `yaml` - YAML format
145-
146-
**Examples:**
147-
148-
```bash
149-
# Use JSON output for scripting
150-
DEVBOX_ID=$(rli devbox create --name my-devbox -o json | jq -r '.id')
151-
152-
# Use YAML for configuration files
153-
rli devbox get <id> -o yaml > devbox-config.yaml
154-
155-
# Use text for simple output
156-
rli devbox list -o text
157-
```
158122

159123
## MCP Server (AI Integration)
160124

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json}\"",
2121
"lint": "eslint src --ext .ts,.tsx",
2222
"lint:fix": "eslint src --ext .ts,.tsx --fix",
23-
"test": "jest",
24-
"test:watch": "jest --watch",
25-
"test:coverage": "jest --coverage",
23+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
24+
"test:watch": "NODE_OPTIONS='--experimental-vm-modules' jest --watch",
25+
"test:coverage": "NODE_OPTIONS='--experimental-vm-modules' jest --coverage",
2626
"test:components": "NODE_OPTIONS='--experimental-vm-modules' jest --config jest.components.config.js --coverage --forceExit",
27-
"docs:commands": "npm run build && node scripts/generate-command-docs.js"
27+
"docs:commands": "npm run build && node scripts/generate-command-docs.js",
28+
"prepare": "husky"
2829
},
2930
"keywords": [
3031
"runloop",
@@ -97,6 +98,7 @@
9798
"eslint-plugin-react": "^7.37.5",
9899
"eslint-plugin-react-hooks": "^6.1.1",
99100
"globals": "^16.4.0",
101+
"husky": "^9.1.7",
100102
"ink-testing-library": "^4.0.0",
101103
"jest": "^29.7.0",
102104
"prettier": "^3.6.2",

tests/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Load environment variables from .env file if it exists
2+
import { jest } from "@jest/globals";
23
import { config } from "dotenv";
34
import { existsSync } from "fs";
45
import { join } from "path";

0 commit comments

Comments
 (0)