@saschabrunnerch/arcgis-maps-sdk-js-ai-context 0.0.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/LICENSE +21 -0
- package/README.md +201 -0
- package/bin/cli.js +173 -0
- package/contexts/4.34/claude/arcgis-3d-advanced/SKILL.md +586 -0
- package/contexts/4.34/claude/arcgis-advanced-layers/SKILL.md +431 -0
- package/contexts/4.34/claude/arcgis-analysis-services/SKILL.md +607 -0
- package/contexts/4.34/claude/arcgis-arcade/SKILL.md +366 -0
- package/contexts/4.34/claude/arcgis-authentication/SKILL.md +301 -0
- package/contexts/4.34/claude/arcgis-cim-symbols/SKILL.md +486 -0
- package/contexts/4.34/claude/arcgis-coordinates-projection/SKILL.md +406 -0
- package/contexts/4.34/claude/arcgis-core-maps/SKILL.md +739 -0
- package/contexts/4.34/claude/arcgis-core-utilities/SKILL.md +732 -0
- package/contexts/4.34/claude/arcgis-custom-rendering/SKILL.md +445 -0
- package/contexts/4.34/claude/arcgis-editing-advanced/SKILL.md +702 -0
- package/contexts/4.34/claude/arcgis-feature-effects/SKILL.md +393 -0
- package/contexts/4.34/claude/arcgis-geometry-operations/SKILL.md +489 -0
- package/contexts/4.34/claude/arcgis-imagery/SKILL.md +307 -0
- package/contexts/4.34/claude/arcgis-interaction/SKILL.md +572 -0
- package/contexts/4.34/claude/arcgis-knowledge-graphs/SKILL.md +582 -0
- package/contexts/4.34/claude/arcgis-layers/SKILL.md +601 -0
- package/contexts/4.34/claude/arcgis-map-tools/SKILL.md +668 -0
- package/contexts/4.34/claude/arcgis-media-layers/SKILL.md +290 -0
- package/contexts/4.34/claude/arcgis-popup-templates/SKILL.md +891 -0
- package/contexts/4.34/claude/arcgis-portal-content/SKILL.md +679 -0
- package/contexts/4.34/claude/arcgis-scene-effects/SKILL.md +512 -0
- package/contexts/4.34/claude/arcgis-smart-mapping/SKILL.md +686 -0
- package/contexts/4.34/claude/arcgis-tables-forms/SKILL.md +877 -0
- package/contexts/4.34/claude/arcgis-time-animation/SKILL.md +722 -0
- package/contexts/4.34/claude/arcgis-utility-networks/SKILL.md +301 -0
- package/contexts/4.34/claude/arcgis-visualization/SKILL.md +580 -0
- package/contexts/4.34/claude/arcgis-widgets-ui/SKILL.md +574 -0
- package/contexts/4.34/copilot/arcgis-3d.instructions.md +267 -0
- package/contexts/4.34/copilot/arcgis-analysis.instructions.md +294 -0
- package/contexts/4.34/copilot/arcgis-arcade.instructions.md +234 -0
- package/contexts/4.34/copilot/arcgis-authentication.instructions.md +187 -0
- package/contexts/4.34/copilot/arcgis-cim-symbols.instructions.md +177 -0
- package/contexts/4.34/copilot/arcgis-core-maps.instructions.md +246 -0
- package/contexts/4.34/copilot/arcgis-core-utilities.instructions.md +247 -0
- package/contexts/4.34/copilot/arcgis-editing.instructions.md +262 -0
- package/contexts/4.34/copilot/arcgis-geometry.instructions.md +225 -0
- package/contexts/4.34/copilot/arcgis-layers.instructions.md +278 -0
- package/contexts/4.34/copilot/arcgis-popup-templates.instructions.md +266 -0
- package/contexts/4.34/copilot/arcgis-portal-advanced.instructions.md +275 -0
- package/contexts/4.34/copilot/arcgis-smart-mapping.instructions.md +184 -0
- package/contexts/4.34/copilot/arcgis-time-animation.instructions.md +112 -0
- package/contexts/4.34/copilot/arcgis-visualization.instructions.md +321 -0
- package/contexts/4.34/copilot/arcgis-widgets-ui.instructions.md +277 -0
- package/lib/installer.js +379 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Sascha Brunner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# arcgis-maps-sdk-js-ai-context
|
|
2
|
+
|
|
3
|
+
> **DISCLAIMER:** This is work in progress and not yet tested extensively. Use at your own risk.
|
|
4
|
+
|
|
5
|
+
Install AI assistant context files for [ArcGIS Maps SDK for JavaScript](https://developers.arcgis.com/javascript/) development. Supports Claude skills and GitHub Copilot instructions.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Claude Skills**: Comprehensive skill files for Claude AI assistant covering all major ArcGIS Maps SDK features
|
|
10
|
+
- **GitHub Copilot Instructions**: Context files for GitHub Copilot to improve code suggestions
|
|
11
|
+
- **SDK Version Selection**: Choose context files for specific ArcGIS Maps SDK versions
|
|
12
|
+
- **Cross-platform**: Works on Windows, macOS, and Linux
|
|
13
|
+
- **Zero dependencies**: Uses only built-in Node.js modules
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
No installation required! Run directly with npx:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context <command>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
### Install Claude Skills
|
|
26
|
+
|
|
27
|
+
Installs Claude skill files to `.claude/skills/arcgis-maps-sdk-js/` in your project:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Install for latest SDK version
|
|
31
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context claude
|
|
32
|
+
|
|
33
|
+
# Install for specific SDK version
|
|
34
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context claude --sdk 4.34
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Install GitHub Copilot Instructions
|
|
38
|
+
|
|
39
|
+
Installs Copilot instruction files to `.github/instructions/` in your project:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Install for latest SDK version
|
|
43
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context copilot
|
|
44
|
+
|
|
45
|
+
# Install for specific SDK version
|
|
46
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context copilot --sdk 4.34
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Install All
|
|
50
|
+
|
|
51
|
+
Installs both Claude skills and Copilot instructions:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Install for latest SDK version
|
|
55
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context all
|
|
56
|
+
|
|
57
|
+
# Install for specific SDK version
|
|
58
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context all --sdk 4.34
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### List Available Contexts
|
|
62
|
+
|
|
63
|
+
Shows all available SDK versions and context files:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context list
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Help
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context --help
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## SDK Version Selection
|
|
76
|
+
|
|
77
|
+
Use the `--sdk` flag to install context files for a specific ArcGIS Maps SDK version:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx @saschabrunnerch/arcgis-maps-sdk-js-ai-context claude --sdk 4.34
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Available versions can be viewed with the `list` command. If no version is specified, the latest available version is used.
|
|
84
|
+
|
|
85
|
+
| SDK Version | Status |
|
|
86
|
+
|-------------|--------|
|
|
87
|
+
| 4.34 | Available |
|
|
88
|
+
|
|
89
|
+
## Claude Skills Included
|
|
90
|
+
|
|
91
|
+
The package includes 28 comprehensive Claude skills covering:
|
|
92
|
+
|
|
93
|
+
| Skill | Description |
|
|
94
|
+
|-------|-------------|
|
|
95
|
+
| arcgis-core-maps | 2D and 3D map creation, views, navigation |
|
|
96
|
+
| arcgis-layers | FeatureLayer, TileLayer, GeoJSONLayer, and more |
|
|
97
|
+
| arcgis-visualization | Renderers, symbols, and visual variables |
|
|
98
|
+
| arcgis-popup-templates | Popup configuration and content |
|
|
99
|
+
| arcgis-widgets-ui | Built-in widgets and UI components |
|
|
100
|
+
| arcgis-geometry-operations | Geometry engine and spatial operations |
|
|
101
|
+
| arcgis-coordinates-projection | Coordinate systems and projections |
|
|
102
|
+
| arcgis-authentication | OAuth, API keys, and identity management |
|
|
103
|
+
| arcgis-portal-content | Portal items, groups, and content management |
|
|
104
|
+
| arcgis-smart-mapping | Smart mapping and data-driven visualization |
|
|
105
|
+
| arcgis-editing-advanced | Feature editing and sketching |
|
|
106
|
+
| arcgis-analysis-services | Spatial analysis and geoprocessing |
|
|
107
|
+
| arcgis-3d-advanced | 3D visualization and SceneView |
|
|
108
|
+
| arcgis-scene-effects | 3D effects, lighting, and atmosphere |
|
|
109
|
+
| arcgis-cim-symbols | CIM symbol specification |
|
|
110
|
+
| arcgis-arcade | Arcade expressions |
|
|
111
|
+
| arcgis-time-animation | Time-aware layers and animation |
|
|
112
|
+
| arcgis-feature-effects | Feature effects and filters |
|
|
113
|
+
| arcgis-custom-rendering | Custom WebGL rendering |
|
|
114
|
+
| arcgis-interaction | View interaction and events |
|
|
115
|
+
| arcgis-map-tools | Measurement, print, and utility tools |
|
|
116
|
+
| arcgis-tables-forms | Attribute tables and feature forms |
|
|
117
|
+
| arcgis-media-layers | Media and image layers |
|
|
118
|
+
| arcgis-advanced-layers | Specialized layer types |
|
|
119
|
+
| arcgis-imagery | Imagery and raster analysis |
|
|
120
|
+
| arcgis-knowledge-graphs | Knowledge graph integration |
|
|
121
|
+
| arcgis-utility-networks | Utility network analysis |
|
|
122
|
+
| arcgis-core-utilities | Core utilities and helpers |
|
|
123
|
+
|
|
124
|
+
## GitHub Copilot Instructions
|
|
125
|
+
|
|
126
|
+
The package includes 16 comprehensive Copilot instruction files covering all topics:
|
|
127
|
+
|
|
128
|
+
| File | Coverage |
|
|
129
|
+
|------|----------|
|
|
130
|
+
| arcgis-core-maps.instructions.md | Maps, views, navigation, imports |
|
|
131
|
+
| arcgis-layers.instructions.md | All layer types, queries, management |
|
|
132
|
+
| arcgis-visualization.instructions.md | Renderers, symbols, visual variables, labels |
|
|
133
|
+
| arcgis-widgets-ui.instructions.md | Widgets, Calcite Design System |
|
|
134
|
+
| arcgis-popup-templates.instructions.md | Popup content, charts, expressions |
|
|
135
|
+
| arcgis-geometry.instructions.md | Geometry operators, spatial operations, projection |
|
|
136
|
+
| arcgis-authentication.instructions.md | OAuth, API keys, identity |
|
|
137
|
+
| arcgis-editing.instructions.md | Editor, Sketch, forms, versioning |
|
|
138
|
+
| arcgis-3d.instructions.md | SceneView, 3D layers, weather, lighting, effects |
|
|
139
|
+
| arcgis-arcade.instructions.md | Arcade expressions for all contexts |
|
|
140
|
+
| arcgis-analysis.instructions.md | Analysis tools, measurement, print |
|
|
141
|
+
| arcgis-smart-mapping.instructions.md | Auto-generated renderers, statistics |
|
|
142
|
+
| arcgis-time-animation.instructions.md | TimeSlider, temporal data |
|
|
143
|
+
| arcgis-cim-symbols.instructions.md | Advanced CIM symbology |
|
|
144
|
+
| arcgis-portal-advanced.instructions.md | Portal, imagery, media layers, utility networks, knowledge graphs |
|
|
145
|
+
| arcgis-core-utilities.instructions.md | reactiveUtils, Collection, hit testing, highlighting, events |
|
|
146
|
+
|
|
147
|
+
Each file provides:
|
|
148
|
+
- Import patterns and best practices
|
|
149
|
+
- Comprehensive code examples
|
|
150
|
+
- TypeScript guidance with `as const`
|
|
151
|
+
- Common pitfalls to avoid
|
|
152
|
+
|
|
153
|
+
## Usage with Claude
|
|
154
|
+
|
|
155
|
+
After installing Claude skills, Claude will automatically have access to ArcGIS-specific knowledge when working in your project. The skills provide:
|
|
156
|
+
|
|
157
|
+
- Correct import patterns for ESM and CDN usage
|
|
158
|
+
- Best practices for TypeScript with autocasting
|
|
159
|
+
- Code examples for common tasks
|
|
160
|
+
- API reference guidance
|
|
161
|
+
|
|
162
|
+
## Usage with GitHub Copilot
|
|
163
|
+
|
|
164
|
+
After installing Copilot instructions, GitHub Copilot will provide better suggestions for:
|
|
165
|
+
|
|
166
|
+
- ArcGIS API imports
|
|
167
|
+
- Map and view initialization
|
|
168
|
+
- Layer configuration
|
|
169
|
+
- Widget setup
|
|
170
|
+
- Common patterns
|
|
171
|
+
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
- Node.js 14.0.0 or higher
|
|
175
|
+
|
|
176
|
+
## Source
|
|
177
|
+
|
|
178
|
+
The context files in this package are based on the official ArcGIS Maps SDK for JavaScript documentation:
|
|
179
|
+
|
|
180
|
+
- **Documentation:** https://developers.arcgis.com/javascript/latest/downloads/
|
|
181
|
+
- **Folders used:** `api-reference` and `sample-code`
|
|
182
|
+
|
|
183
|
+
## AI Assistance Declaration
|
|
184
|
+
|
|
185
|
+
This project was primarily developed using AI coding assistants. The maintainer directed the development through prompts and reviewed all generated code.
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
MIT
|
|
190
|
+
|
|
191
|
+
## Contributing
|
|
192
|
+
|
|
193
|
+
Contributions are welcome! Please feel free to submit issues and pull requests at:
|
|
194
|
+
|
|
195
|
+
https://github.com/SaschaBrunnerCH/arcgis-maps-sdk-js-ai-context
|
|
196
|
+
|
|
197
|
+
## Related
|
|
198
|
+
|
|
199
|
+
- [ArcGIS Maps SDK for JavaScript](https://developers.arcgis.com/javascript/)
|
|
200
|
+
- [Claude](https://claude.ai/)
|
|
201
|
+
- [GitHub Copilot](https://github.com/features/copilot)
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const { installClaude, installCopilot, installAll, listContexts, getAvailableVersions, colors, colorize, log } = require('../lib/installer');
|
|
6
|
+
|
|
7
|
+
const pkg = require('../package.json');
|
|
8
|
+
|
|
9
|
+
const COMMANDS = {
|
|
10
|
+
claude: 'Install Claude skills to .claude/skills/arcgis-maps-sdk-js/',
|
|
11
|
+
copilot: 'Install GitHub Copilot instructions to .github/instructions/',
|
|
12
|
+
all: 'Install both Claude skills and Copilot instructions (latest SDK version)',
|
|
13
|
+
list: 'Show available contexts and SDK versions',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function showBanner() {
|
|
17
|
+
log('');
|
|
18
|
+
log(colorize('bold', colorize('cyan', ' ArcGIS Maps SDK for JavaScript - AI Context Installer')));
|
|
19
|
+
log(colorize('dim', ` Version ${pkg.version}`));
|
|
20
|
+
log('');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function showHelp() {
|
|
24
|
+
showBanner();
|
|
25
|
+
|
|
26
|
+
log(colorize('bold', 'USAGE'));
|
|
27
|
+
log(` npx ${pkg.name} <command> [options]`);
|
|
28
|
+
log('');
|
|
29
|
+
|
|
30
|
+
log(colorize('bold', 'COMMANDS'));
|
|
31
|
+
for (const [cmd, desc] of Object.entries(COMMANDS)) {
|
|
32
|
+
log(` ${colorize('cyan', cmd.padEnd(12))} ${desc}`);
|
|
33
|
+
}
|
|
34
|
+
log('');
|
|
35
|
+
|
|
36
|
+
log(colorize('bold', 'OPTIONS'));
|
|
37
|
+
log(` ${colorize('cyan', '--sdk <ver>'.padEnd(16))} ArcGIS SDK version (e.g., 4.34)`);
|
|
38
|
+
log(` ${colorize('cyan', '--help, -h'.padEnd(16))} Show this help message`);
|
|
39
|
+
log(` ${colorize('cyan', '--version, -v'.padEnd(16))} Show package version number`);
|
|
40
|
+
log('');
|
|
41
|
+
|
|
42
|
+
const versions = getAvailableVersions();
|
|
43
|
+
log(colorize('bold', 'AVAILABLE SDK VERSIONS'));
|
|
44
|
+
log(` ${versions.join(', ')} ${colorize('dim', `(default: ${versions[versions.length - 1]})`)}`);
|
|
45
|
+
log('');
|
|
46
|
+
|
|
47
|
+
log(colorize('bold', 'EXAMPLES'));
|
|
48
|
+
log(colorize('dim', ' # Install Claude skills (latest SDK version)'));
|
|
49
|
+
log(` npx ${pkg.name} claude`);
|
|
50
|
+
log('');
|
|
51
|
+
log(colorize('dim', ' # Install Claude skills for specific SDK version'));
|
|
52
|
+
log(` npx ${pkg.name} claude --sdk 4.34`);
|
|
53
|
+
log('');
|
|
54
|
+
log(colorize('dim', ' # Install GitHub Copilot instructions'));
|
|
55
|
+
log(` npx ${pkg.name} copilot --sdk 4.34`);
|
|
56
|
+
log('');
|
|
57
|
+
log(colorize('dim', ' # Install everything'));
|
|
58
|
+
log(` npx ${pkg.name} all`);
|
|
59
|
+
log('');
|
|
60
|
+
log(colorize('dim', ' # List available contexts and versions'));
|
|
61
|
+
log(` npx ${pkg.name} list`);
|
|
62
|
+
log('');
|
|
63
|
+
|
|
64
|
+
log(colorize('bold', 'MORE INFO'));
|
|
65
|
+
log(` ${colorize('blue', pkg.homepage)}`);
|
|
66
|
+
log('');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function showVersion() {
|
|
70
|
+
log(`${pkg.name} v${pkg.version}`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function parseArgs(args) {
|
|
74
|
+
const result = {
|
|
75
|
+
command: null,
|
|
76
|
+
sdkVersion: null,
|
|
77
|
+
help: false,
|
|
78
|
+
version: false,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
for (let i = 0; i < args.length; i++) {
|
|
82
|
+
const arg = args[i];
|
|
83
|
+
|
|
84
|
+
if (arg === '--help' || arg === '-h') {
|
|
85
|
+
result.help = true;
|
|
86
|
+
} else if (arg === '--version' || arg === '-v') {
|
|
87
|
+
result.version = true;
|
|
88
|
+
} else if (arg === '--sdk') {
|
|
89
|
+
result.sdkVersion = args[i + 1];
|
|
90
|
+
i++; // Skip next arg
|
|
91
|
+
} else if (arg.startsWith('--sdk=')) {
|
|
92
|
+
result.sdkVersion = arg.split('=')[1];
|
|
93
|
+
} else if (!arg.startsWith('-') && !result.command) {
|
|
94
|
+
result.command = arg;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function main() {
|
|
102
|
+
const args = process.argv.slice(2);
|
|
103
|
+
const parsed = parseArgs(args);
|
|
104
|
+
|
|
105
|
+
// Handle flags
|
|
106
|
+
if (parsed.help) {
|
|
107
|
+
showHelp();
|
|
108
|
+
process.exit(0);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (parsed.version) {
|
|
112
|
+
showVersion();
|
|
113
|
+
process.exit(0);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Get command
|
|
117
|
+
const command = parsed.command;
|
|
118
|
+
|
|
119
|
+
if (!command) {
|
|
120
|
+
showHelp();
|
|
121
|
+
process.exit(0);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Validate SDK version if provided
|
|
125
|
+
const versions = getAvailableVersions();
|
|
126
|
+
let sdkVersion = parsed.sdkVersion;
|
|
127
|
+
|
|
128
|
+
if (sdkVersion && !versions.includes(sdkVersion)) {
|
|
129
|
+
log(`${colorize('red', 'Error:')} SDK version "${sdkVersion}" is not available.`);
|
|
130
|
+
log(`Available versions: ${versions.join(', ')}`);
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Default to latest version
|
|
135
|
+
if (!sdkVersion) {
|
|
136
|
+
sdkVersion = versions[versions.length - 1];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Execute command
|
|
140
|
+
showBanner();
|
|
141
|
+
|
|
142
|
+
let success = false;
|
|
143
|
+
|
|
144
|
+
switch (command.toLowerCase()) {
|
|
145
|
+
case 'claude':
|
|
146
|
+
success = installClaude(process.cwd(), sdkVersion);
|
|
147
|
+
break;
|
|
148
|
+
|
|
149
|
+
case 'copilot':
|
|
150
|
+
success = installCopilot(process.cwd(), sdkVersion);
|
|
151
|
+
break;
|
|
152
|
+
|
|
153
|
+
case 'all':
|
|
154
|
+
success = installAll(process.cwd(), sdkVersion);
|
|
155
|
+
break;
|
|
156
|
+
|
|
157
|
+
case 'list':
|
|
158
|
+
listContexts();
|
|
159
|
+
success = true;
|
|
160
|
+
break;
|
|
161
|
+
|
|
162
|
+
default:
|
|
163
|
+
log(`${colorize('red', 'Error:')} Unknown command "${command}"`);
|
|
164
|
+
log('');
|
|
165
|
+
log(`Run ${colorize('cyan', `npx ${pkg.name} --help`)} for usage information.`);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
log('');
|
|
170
|
+
process.exit(success ? 0 : 1);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
main();
|