Skip to content

Commit b6017d1

Browse files
committed
Add activate grid skill
1 parent 2258493 commit b6017d1

1 file changed

Lines changed: 52 additions & 17 deletions

File tree

.claude/skills/grid-api/SKILL.md

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,71 @@ For detailed information, read these reference files in the `references/` direct
5555

5656
## Configuration
5757

58-
**Prerequisites**: Build the CLI before first use:
58+
**IMPORTANT**: Before building the CLI, you MUST configure credentials. Follow this order:
59+
60+
### Step 1: Check Environment Variables
61+
62+
First, check if credentials are already set in the current environment:
5963
```bash
60-
cd cli && npm install && npm run build && cd ..
64+
echo "Token ID: ${GRID_API_TOKEN_ID:+[set]}"
65+
echo "Client Secret: ${GRID_API_CLIENT_SECRET:+[set]}"
66+
echo "Base URL: ${GRID_BASE_URL:-https://api.lightspark.com/grid/2025-10-13}"
6167
```
6268

63-
### Quick Setup (Recommended)
69+
**IMPORTANT**: Never output or echo actual credential values. Only check if they are set.
70+
71+
If both show `[set]`, skip to Step 4 (Build CLI). If either is empty, continue to Step 2.
72+
73+
### Step 2: Check for Setup Script
6474

65-
Run the interactive configuration command:
75+
If environment variables are not set, check for the setup script:
6676
```bash
67-
node cli/dist/index.js configure
77+
ls -la setup-grid-credentials.sh 2>/dev/null
6878
```
6979

70-
This will:
71-
1. Prompt for your API Token ID and Client Secret
72-
2. Validate the credentials against the API
73-
3. Save them to `~/.grid-credentials`
80+
If the script exists, source it to load credentials:
81+
```bash
82+
source ./setup-grid-credentials.sh
83+
```
7484

75-
### Alternative: Environment Variables
85+
Then verify the credentials are now set (repeat Step 1 check).
7686

77-
You can also configure via environment variables:
78-
- `GRID_API_TOKEN_ID` - API token ID
79-
- `GRID_API_CLIENT_SECRET` - API client secret
80-
- `GRID_BASE_URL` - Base URL (defaults to `https://api.lightspark.com/grid/2025-10-13`)
87+
### Step 3: Prompt for Credentials (if needed)
88+
89+
**Skip this step if** environment variables are set (Step 1) OR the setup script exists (Step 2).
90+
91+
Only if neither exists, prompt the user for credentials one at a time:
8192

82-
### Non-Interactive Setup
93+
1. First, ask for their **API Token ID** (`GRID_API_TOKEN_ID`)
94+
2. After receiving the token ID, ask for their **Client Secret** (`GRID_API_CLIENT_SECRET`)
95+
3. Finally, ask if they want to override the default base URL (`https://api.lightspark.com/grid/2025-10-13`). Only request `GRID_BASE_URL` if they say yes.
8396

97+
**SECURITY**: When the user provides credentials:
98+
- Never echo, log, or display the credential values
99+
- Never include credentials in command output or error messages
100+
- Export them directly without confirmation output
101+
102+
Once provided, export the credentials silently (do not echo):
84103
```bash
85-
node cli/dist/index.js configure --token-id <id> --client-secret <secret>
104+
export GRID_API_TOKEN_ID="<user-provided-token-id>"
105+
export GRID_API_CLIENT_SECRET="<user-provided-client-secret>"
106+
# Optional: only if user provided a custom base URL
107+
export GRID_BASE_URL="<user-provided-base-url>"
86108
```
87109

110+
### Step 4: Build the CLI
111+
112+
Only after credentials are configured, build the CLI:
113+
```bash
114+
cd cli && npm install && npm run build && cd ..
115+
```
116+
117+
### Environment Variables Reference
118+
119+
- `GRID_API_TOKEN_ID` - API token ID (required)
120+
- `GRID_API_CLIENT_SECRET` - API client secret (required)
121+
- `GRID_BASE_URL` - Base URL (defaults to `https://api.lightspark.com/grid/2025-10-13`)
122+
88123
## CLI Commands
89124

90125
Run all CLI commands from the repo root using: `node cli/dist/index.js <command>`
@@ -376,4 +411,4 @@ Or on error:
376411
- `INVALID_INPUT` - Check required fields; the `reason` field has details
377412
- `MISSING_MANDATORY_USER_INFO` - Customer or sender info missing required fields
378413

379-
Always check the `success` field and report errors clearly to the user.
414+
Always check the `success` field and report errors clearly to the user.

0 commit comments

Comments
 (0)