cursortoys 0.2.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/llms.txt ADDED
@@ -0,0 +1,204 @@
1
+ # CursorToys CLI - Instructions for LLMs
2
+
3
+ ## Overview
4
+
5
+ The CursorToys CLI is a command-line utility for productivity, testing, and automation. It provides tools for HTTP testing, skill management, and more.
6
+
7
+ ## Available Commands
8
+
9
+ ### 1. HTTP Test (`cursortoys http test`)
10
+
11
+ Run HTTP request files (`.req` / `.request`) as automated tests.
12
+
13
+ **Basic usage:**
14
+ ```bash
15
+ cursortoys http test
16
+ ```
17
+
18
+ **Full command syntax:**
19
+ ```bash
20
+ cursortoys http test [options]
21
+ ```
22
+
23
+ **Options:**
24
+ - `-p, --project <dir>`: Project directory (default: current working directory)
25
+ - `--base-folder <name>`: Base folder name (default: `cursor`; or set `CURSORTOYS_BASE_FOLDER`)
26
+ - `--environments-folder <name>`: Environments subfolder (default: `.environments`)
27
+ - `-e, --env <name>`: Environment to use (overrides `# @env` in file)
28
+ - `-t, --timeout <seconds>`: Request timeout in seconds (default: `10`)
29
+ - `-f, --file <path>`: Run a single `.req` or `.request` file
30
+ - `-V, --verbose`: Show request and response details
31
+ - `--var <key=value>`: Override variables (can be repeated)
32
+
33
+ **Examples:**
34
+ ```bash
35
+ # Run all tests
36
+ cursortoys http test
37
+
38
+ # Run with verbose output
39
+ cursortoys http test -V
40
+
41
+ # Run specific file
42
+ cursortoys http test -f .cursor/http/api.req
43
+
44
+ # Override environment and variables
45
+ cursortoys http test -e qa --var BASE_URL=https://staging.api.com --var API_KEY=secret
46
+ ```
47
+
48
+ **Request File Format:**
49
+ - REST Client format: `METHOD URL` followed by headers and body
50
+ - Multiple requests separated by `###`
51
+ - Variables: `# @var VAR_NAME=value`
52
+ - Environment: `# @env name`
53
+ - Substitution: `{{VAR_NAME}}`
54
+ - Delay: `# @delay(milliseconds)` - adds delay before executing the request block
55
+
56
+ **Assertions:**
57
+ Supports various assertion types:
58
+ - Status code: `# @assert response.status == 200`
59
+ - Headers: `# @assert response.headers['content-type'] contains 'application/json'`
60
+ - Body: `# @assert response.body.data.length > 0`
61
+ - JSON path: `# @assert response.body.user.name == "John"`
62
+
63
+ ### 2. Skill Add (`cursortoys skill add`)
64
+
65
+ Create a new skill file with a template.
66
+
67
+ **Basic usage:**
68
+ ```bash
69
+ cursortoys skill add <name>
70
+ ```
71
+
72
+ **Full command syntax:**
73
+ ```bash
74
+ cursortoys skill add <name> [options]
75
+ ```
76
+
77
+ **Options:**
78
+ - `-d, --description <text>`: Skill description
79
+ - `-t, --target <type>`: Target directory (`personal` or `project`, default: `personal`)
80
+ - `-p, --project <dir>`: Project directory (required if target is `project`)
81
+ - `--base-folder <name>`: Base folder name (default: `cursor`)
82
+
83
+ **Examples:**
84
+ ```bash
85
+ # Create personal skill (default)
86
+ cursortoys skill add my-skill
87
+
88
+ # Create personal skill with description
89
+ cursortoys skill add http-testing -d "Skill for testing HTTP APIs"
90
+
91
+ # Create project skill
92
+ cursortoys skill add api-docs -t project -p /path/to/project
93
+
94
+ # Create project skill in current directory
95
+ cursortoys skill add api-docs -t project -p .
96
+
97
+ # Custom base folder
98
+ cursortoys skill add my-skill --base-folder vscode
99
+ ```
100
+
101
+ **Output:**
102
+ Creates a `SKILL.md` file in:
103
+ - Personal: `~/.cursor/skills/skill-name/SKILL.md`
104
+ - Project: `{project}/.cursor/skills/skill-name/SKILL.md`
105
+
106
+ The file contains a template with:
107
+ - Description section
108
+ - When to Use section
109
+ - How It Works section
110
+ - Examples section
111
+ - Notes section
112
+ - Related Skills section
113
+
114
+ ### 3. LLM Instructions (`cursortoys --llm`)
115
+
116
+ Display comprehensive instructions for LLMs on how to use the CLI.
117
+
118
+ **Usage:**
119
+ ```bash
120
+ cursortoys --llm
121
+ ```
122
+
123
+ **Output:**
124
+ Displays this file (llms.txt) with all documentation about commands, options, usage patterns, and best practices.
125
+
126
+ ## Environment Variables
127
+
128
+ - `CURSORTOYS_BASE_FOLDER`: Default base folder (default: `cursor`)
129
+ - `CURSORTOYS_ENVIRONMENTS_FOLDER`: Environments subfolder (default: `.environments`)
130
+
131
+ ## Paths and Structure
132
+
133
+ ### HTTP Testing
134
+ - **HTTP folder**: `{workspace}/.{baseFolder}/http/`
135
+ - **Environments**: `{workspace}/.{baseFolder}/http/{environmentsFolder}/`
136
+ - **Environment files**: `.env`, `.env.dev`, `.env.qa`, `.env.prod`, etc.
137
+
138
+ ### Skills
139
+ - **Personal skills**: `~/.cursor/skills/{skill-name}/SKILL.md`
140
+ - **Project skills**: `{project}/.cursor/skills/{skill-name}/SKILL.md`
141
+
142
+ ## Exit Codes
143
+
144
+ - `0`: Success (all tests passed, command completed successfully)
145
+ - `1`: Failure (tests failed, error occurred)
146
+
147
+ ## Requirements
148
+
149
+ - Node.js 18+
150
+ - `curl` installed and on PATH (for HTTP testing)
151
+
152
+ ## Integration with VS Code/Cursor
153
+
154
+ The CLI uses the same format and conventions as the CursorToys VS Code extension:
155
+ - Same `.req` / `.request` file format
156
+ - Same environment variable resolution
157
+ - Same base folder configuration
158
+ - Skills are compatible with Cursor AI Agent Skills
159
+
160
+ ## Tips for LLMs
161
+
162
+ 1. **HTTP Testing**: When users want to test APIs, suggest using `cursortoys http test` with appropriate options
163
+ 2. **Skill Creation**: When users want to create reusable AI instructions, use `cursortoys skill add`
164
+ 3. **Verbose Mode**: Use `-V` when debugging to see full request/response details
165
+ 4. **Environment Switching**: Use `-e` to switch between dev/qa/prod environments
166
+ 5. **Variable Overrides**: Use `--var` to override specific variables without modifying files
167
+ 6. **Project vs Personal**: Skills can be personal (shared across projects) or project-specific
168
+
169
+ ## Common Use Cases
170
+
171
+ ### Use Case 1: API Testing in CI/CD
172
+ ```bash
173
+ # Run all tests with production environment
174
+ cursortoys http test -e prod --timeout 30
175
+ ```
176
+
177
+ ### Use Case 2: Local Development Testing
178
+ ```bash
179
+ # Test specific endpoint with verbose output
180
+ cursortoys http test -f .cursor/http/users.req -V --var BASE_URL=http://localhost:3000
181
+ ```
182
+
183
+ ### Use Case 3: Rate-Limited API Testing
184
+ ```bash
185
+ # Test API with delays between requests (using #@delay in .req files)
186
+ cursortoys http test -f .cursor/http/rate-limited-api.req
187
+ ```
188
+
189
+ ### Use Case 4: Creating Reusable Skills
190
+ ```bash
191
+ # Create a skill for API documentation standards
192
+ cursortoys skill add api-docs -d "Standards for documenting REST APIs" -t project
193
+ ```
194
+
195
+ ## Error Handling
196
+
197
+ The CLI provides clear error messages:
198
+ - File not found errors
199
+ - Invalid request format
200
+ - Network errors
201
+ - Assertion failures
202
+ - Environment/variable resolution issues
203
+
204
+ All errors are displayed in red with relevant context.
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "cursortoys",
3
+ "version": "0.2.0",
4
+ "description": "Command-line utilities for CursorToys - HTTP testing, automation, and productivity tools",
5
+ "main": "dist/cli.js",
6
+ "bin": {
7
+ "cursortoys": "./dist/cli.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc -p .",
11
+ "prepare": "npm run build",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "keywords": [
15
+ "cursortoys",
16
+ "cli",
17
+ "utilities",
18
+ "productivity",
19
+ "http",
20
+ "rest",
21
+ "testing",
22
+ "api",
23
+ "automation",
24
+ "request",
25
+ "curl",
26
+ "vscode",
27
+ "cursor",
28
+ "skills",
29
+ "ai",
30
+ "llm"
31
+ ],
32
+ "author": "",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/yourusername/cursortoys-cli.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/yourusername/cursortoys-cli/issues"
40
+ },
41
+ "homepage": "https://github.com/yourusername/cursortoys-cli#readme",
42
+ "files": [
43
+ "dist",
44
+ "llms.txt",
45
+ "README.md",
46
+ "LICENSE"
47
+ ],
48
+ "dependencies": {
49
+ "chalk": "^4.1.2",
50
+ "commander": "^12.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^20.0.0",
54
+ "typescript": "^5.0.0"
55
+ },
56
+ "engines": {
57
+ "node": ">=18.0.0"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public"
61
+ }
62
+ }