@przeprogramowani/10x-cli 1.1.0 → 1.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/README.md +9 -1
- package/dist/index.mjs +121 -90
- package/package.json +1 -1
- package/skills/10x-cli-guide/SKILL.md +220 -0
package/README.md
CHANGED
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
CLI tool for [10xDevs](https://10xdevs.pl) course content. Fetch and apply AI coding skills,
|
|
4
4
|
prompts, and configs directly into your workspace.
|
|
5
5
|
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
- **Node 20+** — this is the only runtime dependency.
|
|
9
|
+
|
|
6
10
|
## Install
|
|
7
11
|
|
|
8
12
|
```bash
|
|
9
|
-
#
|
|
13
|
+
# Zero-install — run directly with npx (no global install needed)
|
|
14
|
+
npx @przeprogramowani/10x-cli auth
|
|
15
|
+
npx @przeprogramowani/10x-cli get m1l1
|
|
16
|
+
|
|
17
|
+
# Or install globally for shorter commands
|
|
10
18
|
npm install -g @przeprogramowani/10x-cli
|
|
11
19
|
|
|
12
20
|
# Or download a standalone binary from GitHub Releases
|
package/dist/index.mjs
CHANGED
|
@@ -2271,7 +2271,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
2271
2271
|
// package.json
|
|
2272
2272
|
var package_default = {
|
|
2273
2273
|
name: "@przeprogramowani/10x-cli",
|
|
2274
|
-
version: "1.
|
|
2274
|
+
version: "1.2.0",
|
|
2275
2275
|
description: "Open-source CLI for 10xDevs course content",
|
|
2276
2276
|
repository: {
|
|
2277
2277
|
type: "git",
|
|
@@ -3565,6 +3565,8 @@ async function fetchLesson(course, lessonId, token, options = {}) {
|
|
|
3565
3565
|
const params = new URLSearchParams;
|
|
3566
3566
|
if (options.lang)
|
|
3567
3567
|
params.set("lang", options.lang);
|
|
3568
|
+
if (options.tool)
|
|
3569
|
+
params.set("tool", options.tool);
|
|
3568
3570
|
const qs = params.toString();
|
|
3569
3571
|
const path = `/api/lessons/${encodeURIComponent(course)}/${encodeURIComponent(lessonId)}${qs ? `?${qs}` : ""}`;
|
|
3570
3572
|
const result = await apiGet(path, { token, signal: options.signal });
|
|
@@ -3699,10 +3701,89 @@ function formatReleaseAt(iso, now = new Date) {
|
|
|
3699
3701
|
return `${absolute} (in ${days} days)`;
|
|
3700
3702
|
}
|
|
3701
3703
|
|
|
3704
|
+
// src/lib/tool-profile.ts
|
|
3705
|
+
var SENTINEL_BEGIN = "<!-- BEGIN @przeprogramowani/10x-cli -->";
|
|
3706
|
+
var SENTINEL_END = "<!-- END @przeprogramowani/10x-cli -->";
|
|
3707
|
+
var PROFILES = {
|
|
3708
|
+
"claude-code": {
|
|
3709
|
+
toolId: "claude-code",
|
|
3710
|
+
displayName: "Claude Code",
|
|
3711
|
+
skillPath: (n) => `.claude/skills/${n}/SKILL.md`,
|
|
3712
|
+
skillDir: (n) => `.claude/skills/${n}`,
|
|
3713
|
+
promptPath: (n) => `.claude/prompts/${n}.md`,
|
|
3714
|
+
configPath: (n) => `.claude/config-templates/${n}`,
|
|
3715
|
+
rulesFile: "CLAUDE.md",
|
|
3716
|
+
manifestDir: ".claude",
|
|
3717
|
+
sentinelBegin: SENTINEL_BEGIN,
|
|
3718
|
+
sentinelEnd: SENTINEL_END
|
|
3719
|
+
},
|
|
3720
|
+
cursor: {
|
|
3721
|
+
toolId: "cursor",
|
|
3722
|
+
displayName: "Cursor",
|
|
3723
|
+
skillPath: (n) => `.cursor/skills/${n}/SKILL.md`,
|
|
3724
|
+
skillDir: (n) => `.cursor/skills/${n}`,
|
|
3725
|
+
promptPath: (n) => `.cursor/prompts/${n}.md`,
|
|
3726
|
+
configPath: (n) => `.cursor/config-templates/${n}`,
|
|
3727
|
+
rulesFile: ".cursor/rules/10x-course.mdc",
|
|
3728
|
+
manifestDir: ".cursor",
|
|
3729
|
+
sentinelBegin: SENTINEL_BEGIN,
|
|
3730
|
+
sentinelEnd: SENTINEL_END
|
|
3731
|
+
},
|
|
3732
|
+
copilot: {
|
|
3733
|
+
toolId: "copilot",
|
|
3734
|
+
displayName: "GitHub Copilot",
|
|
3735
|
+
skillPath: (n) => `.github/skills/${n}/SKILL.md`,
|
|
3736
|
+
skillDir: (n) => `.github/skills/${n}`,
|
|
3737
|
+
promptPath: (n) => `.github/prompts/${n}.md`,
|
|
3738
|
+
configPath: (n) => `.github/config-templates/${n}`,
|
|
3739
|
+
rulesFile: ".github/copilot-instructions.md",
|
|
3740
|
+
manifestDir: ".github",
|
|
3741
|
+
sentinelBegin: SENTINEL_BEGIN,
|
|
3742
|
+
sentinelEnd: SENTINEL_END
|
|
3743
|
+
},
|
|
3744
|
+
codex: {
|
|
3745
|
+
toolId: "codex",
|
|
3746
|
+
displayName: "Codex CLI",
|
|
3747
|
+
skillPath: (n) => `.agents/skills/${n}/SKILL.md`,
|
|
3748
|
+
skillDir: (n) => `.agents/skills/${n}`,
|
|
3749
|
+
promptPath: (n) => `.agents/prompts/${n}.md`,
|
|
3750
|
+
configPath: (n) => `.agents/config-templates/${n}`,
|
|
3751
|
+
rulesFile: "AGENTS.md",
|
|
3752
|
+
manifestDir: ".agents",
|
|
3753
|
+
sentinelBegin: SENTINEL_BEGIN,
|
|
3754
|
+
sentinelEnd: SENTINEL_END
|
|
3755
|
+
},
|
|
3756
|
+
windsurf: {
|
|
3757
|
+
toolId: "windsurf",
|
|
3758
|
+
displayName: "Windsurf",
|
|
3759
|
+
skillPath: (n) => `.windsurf/skills/${n}/SKILL.md`,
|
|
3760
|
+
skillDir: (n) => `.windsurf/skills/${n}`,
|
|
3761
|
+
promptPath: (n) => `.windsurf/prompts/${n}.md`,
|
|
3762
|
+
configPath: (n) => `.windsurf/config-templates/${n}`,
|
|
3763
|
+
rulesFile: ".windsurfrules",
|
|
3764
|
+
manifestDir: ".windsurf",
|
|
3765
|
+
sentinelBegin: SENTINEL_BEGIN,
|
|
3766
|
+
sentinelEnd: SENTINEL_END
|
|
3767
|
+
},
|
|
3768
|
+
generic: {
|
|
3769
|
+
toolId: "generic",
|
|
3770
|
+
displayName: "Other / Generic",
|
|
3771
|
+
skillPath: (n) => `.ai/skills/${n}/SKILL.md`,
|
|
3772
|
+
skillDir: (n) => `.ai/skills/${n}`,
|
|
3773
|
+
promptPath: (n) => `.ai/prompts/${n}.md`,
|
|
3774
|
+
configPath: (n) => `.ai/config-templates/${n}`,
|
|
3775
|
+
rulesFile: "AGENTS.md",
|
|
3776
|
+
manifestDir: ".ai",
|
|
3777
|
+
sentinelBegin: SENTINEL_BEGIN,
|
|
3778
|
+
sentinelEnd: SENTINEL_END
|
|
3779
|
+
}
|
|
3780
|
+
};
|
|
3781
|
+
var DEFAULT_TOOL = "claude-code";
|
|
3782
|
+
|
|
3702
3783
|
// src/commands/doctor.ts
|
|
3703
3784
|
var EX_CONFIG = 78;
|
|
3704
3785
|
function registerDoctorCommand(cli) {
|
|
3705
|
-
cli.command("doctor", "Diagnose auth, API, config, and
|
|
3786
|
+
cli.command("doctor", "Diagnose auth, API, config, and tool directory state").action(async (options) => {
|
|
3706
3787
|
const ctx = resolveContext(options);
|
|
3707
3788
|
await runDoctor(ctx);
|
|
3708
3789
|
});
|
|
@@ -3714,7 +3795,7 @@ async function runDoctor(ctx) {
|
|
|
3714
3795
|
checks.push(await checkApiConnectivity());
|
|
3715
3796
|
checks.push(checkConfigDirectory());
|
|
3716
3797
|
checks.push(checkCliVersion());
|
|
3717
|
-
checks.push(
|
|
3798
|
+
checks.push(checkToolDirectory());
|
|
3718
3799
|
const failed = checks.filter((c2) => c2.status === "fail").length;
|
|
3719
3800
|
const passed = checks.filter((c2) => c2.status === "pass").length;
|
|
3720
3801
|
const warned = checks.filter((c2) => c2.status === "warn").length;
|
|
@@ -3871,36 +3952,39 @@ function checkCliVersion() {
|
|
|
3871
3952
|
details: { version: package_default.version }
|
|
3872
3953
|
};
|
|
3873
3954
|
}
|
|
3874
|
-
function
|
|
3955
|
+
function checkToolDirectory() {
|
|
3875
3956
|
const cwd = process.cwd();
|
|
3876
|
-
const
|
|
3877
|
-
|
|
3957
|
+
const toolId = readToolConfig()?.tool ?? DEFAULT_TOOL;
|
|
3958
|
+
const profile = PROFILES[toolId] ?? PROFILES[DEFAULT_TOOL];
|
|
3959
|
+
const dirName = profile.manifestDir;
|
|
3960
|
+
const toolDir = join2(cwd, dirName);
|
|
3961
|
+
if (!existsSync2(toolDir)) {
|
|
3878
3962
|
return {
|
|
3879
|
-
name: "
|
|
3880
|
-
label:
|
|
3963
|
+
name: "tool-dir",
|
|
3964
|
+
label: profile.displayName,
|
|
3881
3965
|
status: "fail",
|
|
3882
|
-
message:
|
|
3883
|
-
hint:
|
|
3884
|
-
details: { path:
|
|
3966
|
+
message: `${dirName}/ was not found in ${cwd}.`,
|
|
3967
|
+
hint: `Run '10x doctor' from a project directory that already has a ${dirName}/ folder.`,
|
|
3968
|
+
details: { path: toolDir, exists: false, tool: toolId }
|
|
3885
3969
|
};
|
|
3886
3970
|
}
|
|
3887
3971
|
try {
|
|
3888
|
-
accessSync(
|
|
3972
|
+
accessSync(toolDir, constants.W_OK);
|
|
3889
3973
|
return {
|
|
3890
|
-
name: "
|
|
3891
|
-
label:
|
|
3974
|
+
name: "tool-dir",
|
|
3975
|
+
label: profile.displayName,
|
|
3892
3976
|
status: "pass",
|
|
3893
|
-
message: `${
|
|
3894
|
-
details: { path:
|
|
3977
|
+
message: `${toolDir} is writable.`,
|
|
3978
|
+
details: { path: toolDir, exists: true, tool: toolId }
|
|
3895
3979
|
};
|
|
3896
3980
|
} catch (err) {
|
|
3897
3981
|
return {
|
|
3898
|
-
name: "
|
|
3899
|
-
label:
|
|
3982
|
+
name: "tool-dir",
|
|
3983
|
+
label: profile.displayName,
|
|
3900
3984
|
status: "fail",
|
|
3901
|
-
message: `${
|
|
3985
|
+
message: `${toolDir} is not writable.`,
|
|
3902
3986
|
hint: `Fix directory permissions, then run '10x doctor' again. (${err instanceof Error ? err.message : String(err)})`,
|
|
3903
|
-
details: { path:
|
|
3987
|
+
details: { path: toolDir, exists: true, tool: toolId }
|
|
3904
3988
|
};
|
|
3905
3989
|
}
|
|
3906
3990
|
}
|
|
@@ -4017,73 +4101,6 @@ function isStringArray(value) {
|
|
|
4017
4101
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
4018
4102
|
}
|
|
4019
4103
|
|
|
4020
|
-
// src/lib/tool-profile.ts
|
|
4021
|
-
var SENTINEL_BEGIN = "<!-- BEGIN @przeprogramowani/10x-cli -->";
|
|
4022
|
-
var SENTINEL_END = "<!-- END @przeprogramowani/10x-cli -->";
|
|
4023
|
-
var PROFILES = {
|
|
4024
|
-
"claude-code": {
|
|
4025
|
-
toolId: "claude-code",
|
|
4026
|
-
displayName: "Claude Code",
|
|
4027
|
-
skillPath: (n) => `.claude/skills/${n}/SKILL.md`,
|
|
4028
|
-
skillDir: (n) => `.claude/skills/${n}`,
|
|
4029
|
-
promptPath: (n) => `.claude/prompts/${n}.md`,
|
|
4030
|
-
configPath: (n) => `.claude/config-templates/${n}`,
|
|
4031
|
-
rulesFile: "CLAUDE.md",
|
|
4032
|
-
manifestDir: ".claude",
|
|
4033
|
-
sentinelBegin: SENTINEL_BEGIN,
|
|
4034
|
-
sentinelEnd: SENTINEL_END
|
|
4035
|
-
},
|
|
4036
|
-
cursor: {
|
|
4037
|
-
toolId: "cursor",
|
|
4038
|
-
displayName: "Cursor",
|
|
4039
|
-
skillPath: (n) => `.cursor/skills/${n}/SKILL.md`,
|
|
4040
|
-
skillDir: (n) => `.cursor/skills/${n}`,
|
|
4041
|
-
promptPath: (n) => `.cursor/prompts/${n}.md`,
|
|
4042
|
-
configPath: (n) => `.cursor/config-templates/${n}`,
|
|
4043
|
-
rulesFile: ".cursor/rules/10x-course.mdc",
|
|
4044
|
-
manifestDir: ".cursor",
|
|
4045
|
-
sentinelBegin: SENTINEL_BEGIN,
|
|
4046
|
-
sentinelEnd: SENTINEL_END
|
|
4047
|
-
},
|
|
4048
|
-
copilot: {
|
|
4049
|
-
toolId: "copilot",
|
|
4050
|
-
displayName: "GitHub Copilot",
|
|
4051
|
-
skillPath: (n) => `.github/skills/${n}/SKILL.md`,
|
|
4052
|
-
skillDir: (n) => `.github/skills/${n}`,
|
|
4053
|
-
promptPath: (n) => `.github/prompts/${n}.md`,
|
|
4054
|
-
configPath: (n) => `.github/config-templates/${n}`,
|
|
4055
|
-
rulesFile: ".github/copilot-instructions.md",
|
|
4056
|
-
manifestDir: ".github",
|
|
4057
|
-
sentinelBegin: SENTINEL_BEGIN,
|
|
4058
|
-
sentinelEnd: SENTINEL_END
|
|
4059
|
-
},
|
|
4060
|
-
codex: {
|
|
4061
|
-
toolId: "codex",
|
|
4062
|
-
displayName: "Codex CLI",
|
|
4063
|
-
skillPath: (n) => `.agents/skills/${n}/SKILL.md`,
|
|
4064
|
-
skillDir: (n) => `.agents/skills/${n}`,
|
|
4065
|
-
promptPath: (n) => `.agents/prompts/${n}.md`,
|
|
4066
|
-
configPath: (n) => `.agents/config-templates/${n}`,
|
|
4067
|
-
rulesFile: "AGENTS.md",
|
|
4068
|
-
manifestDir: ".agents",
|
|
4069
|
-
sentinelBegin: SENTINEL_BEGIN,
|
|
4070
|
-
sentinelEnd: SENTINEL_END
|
|
4071
|
-
},
|
|
4072
|
-
generic: {
|
|
4073
|
-
toolId: "generic",
|
|
4074
|
-
displayName: "Other / Generic",
|
|
4075
|
-
skillPath: (n) => `.ai/skills/${n}/SKILL.md`,
|
|
4076
|
-
skillDir: (n) => `.ai/skills/${n}`,
|
|
4077
|
-
promptPath: (n) => `.ai/prompts/${n}.md`,
|
|
4078
|
-
configPath: (n) => `.ai/config-templates/${n}`,
|
|
4079
|
-
rulesFile: "AGENTS.md",
|
|
4080
|
-
manifestDir: ".ai",
|
|
4081
|
-
sentinelBegin: SENTINEL_BEGIN,
|
|
4082
|
-
sentinelEnd: SENTINEL_END
|
|
4083
|
-
}
|
|
4084
|
-
};
|
|
4085
|
-
var DEFAULT_TOOL = "claude-code";
|
|
4086
|
-
|
|
4087
4104
|
// src/lib/tool-detect.ts
|
|
4088
4105
|
function detectTools(projectRoot) {
|
|
4089
4106
|
const hit = (rel) => existsSync4(join4(projectRoot, rel));
|
|
@@ -4140,6 +4157,17 @@ function detectTools(projectRoot) {
|
|
|
4140
4157
|
} else if (hit("AGENTS.md") && !hit(".ai")) {
|
|
4141
4158
|
signals.push({ profileId: "codex", confidence: "medium", reason: "AGENTS.md" });
|
|
4142
4159
|
}
|
|
4160
|
+
if (hit(".windsurf/" + MANIFEST_FILENAME)) {
|
|
4161
|
+
signals.push({
|
|
4162
|
+
profileId: "windsurf",
|
|
4163
|
+
confidence: "strong",
|
|
4164
|
+
reason: ".windsurf/.10x-cli-manifest.json"
|
|
4165
|
+
});
|
|
4166
|
+
} else if (hit(".windsurfrules")) {
|
|
4167
|
+
signals.push({ profileId: "windsurf", confidence: "strong", reason: ".windsurfrules" });
|
|
4168
|
+
} else if (hit(".windsurf")) {
|
|
4169
|
+
signals.push({ profileId: "windsurf", confidence: "medium", reason: ".windsurf/ directory" });
|
|
4170
|
+
}
|
|
4143
4171
|
if (hit(".ai/" + MANIFEST_FILENAME)) {
|
|
4144
4172
|
signals.push({
|
|
4145
4173
|
profileId: "generic",
|
|
@@ -4154,7 +4182,7 @@ function detectTools(projectRoot) {
|
|
|
4154
4182
|
return rankSignals(signals);
|
|
4155
4183
|
}
|
|
4156
4184
|
var CONFIDENCE_ORDER = { strong: 3, medium: 2, weak: 1 };
|
|
4157
|
-
var PROFILE_ORDER = ["claude-code", "cursor", "copilot", "codex", "generic"];
|
|
4185
|
+
var PROFILE_ORDER = ["claude-code", "cursor", "copilot", "codex", "windsurf", "generic"];
|
|
4158
4186
|
function rankSignals(signals) {
|
|
4159
4187
|
return [...signals].sort((a2, b2) => {
|
|
4160
4188
|
const c2 = CONFIDENCE_ORDER[b2.confidence] - CONFIDENCE_ORDER[a2.confidence];
|
|
@@ -4904,7 +4932,10 @@ async function runGet(ctx, ref, options) {
|
|
|
4904
4932
|
return;
|
|
4905
4933
|
}
|
|
4906
4934
|
verbose(ctx, `fetching lesson ${course}/${parsed.lessonId}`);
|
|
4907
|
-
const result = await fetchLesson(course, parsed.lessonId, auth.access_token, {
|
|
4935
|
+
const result = await fetchLesson(course, parsed.lessonId, auth.access_token, {
|
|
4936
|
+
lang,
|
|
4937
|
+
tool: profile.toolId
|
|
4938
|
+
});
|
|
4908
4939
|
if (!result.ok) {
|
|
4909
4940
|
handleLessonError(ctx, result.status, result.code, result.error, result.payload);
|
|
4910
4941
|
}
|
|
@@ -4984,7 +5015,7 @@ async function runPrintMode(ctx, lessonId, course, profile, token, lang, options
|
|
|
4984
5015
|
}
|
|
4985
5016
|
} else {
|
|
4986
5017
|
verbose(ctx, `fetching lesson ${course}/${lessonId} (filtering by ${options.type})`);
|
|
4987
|
-
const result = await fetchLesson(course, lessonId, token, { lang });
|
|
5018
|
+
const result = await fetchLesson(course, lessonId, token, { lang, tool: profile.toolId });
|
|
4988
5019
|
if (!result.ok) {
|
|
4989
5020
|
handleLessonError(ctx, result.status, result.code, result.error, result.payload);
|
|
4990
5021
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 10x-cli-guide
|
|
3
|
+
description: Invoke this skill when the user asks how to USE the 10x-cli day-to-day — fetching lessons, listing modules, switching AI tools, troubleshooting errors, understanding where artifacts land, or working on a specific OS (Windows, Linux, macOS). Covers commands (get, list, doctor, auth --status/--logout), tool profiles, artifact locations, common errors, and platform-specific tips. Excludes: first-time installation and onboarding (use 10x-cli-setup instead), developing or contributing to 10x-cli source code, and general programming help.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 10x-cli Daily Usage Guide
|
|
7
|
+
|
|
8
|
+
This skill helps users work with `@przeprogramowani/10x-cli` after it is already installed and authenticated. If the user has not installed or authenticated yet, hand off to the **10x-cli-setup** skill instead.
|
|
9
|
+
|
|
10
|
+
## Step 1: Detect the user's environment
|
|
11
|
+
|
|
12
|
+
Before giving any guidance, gather context silently — run these checks and remember the results. Do not print raw output to the user.
|
|
13
|
+
|
|
14
|
+
### Operating system
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
echo "$OSTYPE" 2>/dev/null || echo "win32"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use the result to tailor path separators, shell syntax, and clipboard commands throughout your answers:
|
|
21
|
+
|
|
22
|
+
| OS | Shell | Home var | Clipboard | Temp dir |
|
|
23
|
+
|----|-------|----------|-----------|----------|
|
|
24
|
+
| macOS (`darwin*`) | zsh / bash | `$HOME` | `pbcopy` | `$TMPDIR` |
|
|
25
|
+
| Linux (`linux-gnu*`) | bash / zsh | `$HOME` | `xclip -selection clipboard` or `xsel --clipboard` | `/tmp` |
|
|
26
|
+
| Windows (`win32` / MSYS / Git Bash) | PowerShell / cmd | `%USERPROFILE%` | `clip.exe` | `%TEMP%` |
|
|
27
|
+
|
|
28
|
+
### Active AI tool
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
10x doctor --json 2>/dev/null | head -1
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Also check which tool profile is configured:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cat ~/.config/10x-cli/config.json 2>/dev/null || cat "$APPDATA/10x-cli/config.json" 2>/dev/null || echo "{}"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If the config contains a `"tool"` key, that is the active profile. If not, the default is `claude-code`.
|
|
41
|
+
|
|
42
|
+
### CLI version
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
10x --version
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Step 2: Answer the user's question using the reference below
|
|
49
|
+
|
|
50
|
+
Use the environment context from Step 1 to personalize every answer. Always use the OS-appropriate shell syntax, paths, and commands. Never show macOS-specific commands to a Windows user or vice versa.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Command Reference
|
|
55
|
+
|
|
56
|
+
### `10x get <ref>` — Fetch and apply lesson artifacts
|
|
57
|
+
|
|
58
|
+
The primary daily command. Fetches a lesson bundle from the API and writes skills, prompts, rules, and config templates to the project directory.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
10x get m1l1 # Fetch module 1, lesson 1
|
|
62
|
+
10x get m2l3 # Fetch module 2, lesson 3
|
|
63
|
+
10x get m1l1 --dry-run # Preview what would be written
|
|
64
|
+
10x get m1l1 --tool cursor # Use a different AI tool profile
|
|
65
|
+
10x get m1l1 --lang pl # Fetch Polish content
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Filtering artifacts:**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
10x get m1l1 --type skills # Only skills
|
|
72
|
+
10x get m1l1 --type skills --name code-review # One specific skill
|
|
73
|
+
10x get m1l1 --print --type skills --name code-review # Print to stdout
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Where artifacts land** (depends on the active tool profile):
|
|
77
|
+
|
|
78
|
+
| Tool | Skills | Prompts | Rules file | Config templates |
|
|
79
|
+
|------|--------|---------|------------|------------------|
|
|
80
|
+
| Claude Code | `.claude/skills/<name>/SKILL.md` | `.claude/prompts/<name>.md` | `CLAUDE.md` | `.claude/config-templates/<name>` |
|
|
81
|
+
| Cursor | `.cursor/skills/<name>/SKILL.md` | `.cursor/prompts/<name>.md` | `.cursor/rules/10x-course.mdc` | `.cursor/config-templates/<name>` |
|
|
82
|
+
| GitHub Copilot | `.github/skills/<name>/SKILL.md` | `.github/prompts/<name>.md` | `.github/copilot-instructions.md` | `.github/config-templates/<name>` |
|
|
83
|
+
| Codex CLI | `.agents/skills/<name>/SKILL.md` | `.agents/prompts/<name>.md` | `AGENTS.md` | `.agents/config-templates/<name>` |
|
|
84
|
+
| Generic | `.ai/skills/<name>/SKILL.md` | `.ai/prompts/<name>.md` | `AGENTS.md` | `.ai/config-templates/<name>` |
|
|
85
|
+
|
|
86
|
+
**Re-applying a lesson** overwrites skills and prompts if content changed, updates the rules sentinel block, but never overwrites config templates (they may contain user edits).
|
|
87
|
+
|
|
88
|
+
**Switching lessons** cleans up artifacts from the previous lesson that are not in the new one, keeps shared artifacts, and adds new ones.
|
|
89
|
+
|
|
90
|
+
### `10x list [module]` — Browse available content
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
10x list # Show all modules with lock state
|
|
94
|
+
10x list m1 # Show lessons in module 1
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Locked modules show their unlock date. Use this to see what is available before fetching.
|
|
98
|
+
|
|
99
|
+
### `10x doctor` — Diagnose problems
|
|
100
|
+
|
|
101
|
+
Runs 5 checks: Auth status, API connectivity, Config directory, CLI version, and tool directory presence.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
10x doctor # Human-readable output
|
|
105
|
+
10x doctor --json # Machine-readable for scripting
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Exit code 78 means at least one check failed.
|
|
109
|
+
|
|
110
|
+
### `10x auth` — Session management
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
10x auth # Start magic-link login
|
|
114
|
+
10x auth --status # Check current session
|
|
115
|
+
10x auth --logout # Clear credentials
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Sessions refresh transparently — if a token is near expiry, the next command refreshes it automatically. You only need to re-auth manually if the session has fully expired.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Switching Tools
|
|
123
|
+
|
|
124
|
+
To change your AI tool (e.g., from Claude Code to Cursor):
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
10x get m1l1 --tool cursor
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The CLI will detect that artifacts from the old tool exist and offer two options:
|
|
131
|
+
|
|
132
|
+
1. **Migrate** (default) — move all artifacts to the new tool's directories, remove the sentinel block from the old rules file.
|
|
133
|
+
2. **Delete** — remove only 10x-managed artifacts from the old tool's directories. Your own files (e.g., `.github/workflows/`) are never touched.
|
|
134
|
+
|
|
135
|
+
The tool choice is saved in the config file (`~/.config/10x-cli/config.json` on macOS/Linux, `%APPDATA%/10x-cli/config.json` on Windows). Future `get` commands will use the new tool without needing `--tool` again.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Platform-Specific Tips
|
|
140
|
+
|
|
141
|
+
### Windows
|
|
142
|
+
|
|
143
|
+
- **Use PowerShell** (not cmd.exe). The CLI outputs ANSI colors and Unicode symbols that render correctly in Windows Terminal + PowerShell but may garble in legacy cmd.
|
|
144
|
+
- **npx works fine**: `npx @przeprogramowani/10x-cli get m1l1` — no global install needed. Node 20+ is the only prerequisite.
|
|
145
|
+
- **Clipboard**: Skills that copy to clipboard use `clip.exe` on Windows. If a skill outputs a clipboard command, it will fall back silently if `clip.exe` is unavailable.
|
|
146
|
+
- **Config location**: `%APPDATA%\10x-cli\config.json` and `%APPDATA%\10x-cli\auth.json`. The CLI creates these automatically.
|
|
147
|
+
- **Path separators**: The CLI uses Node's `path.join()` internally, so forward slashes in command output (like `.claude/skills/code-review/SKILL.md`) work fine on Windows — no need to convert them.
|
|
148
|
+
|
|
149
|
+
### Linux
|
|
150
|
+
|
|
151
|
+
- **Clipboard**: Skills use `xclip -selection clipboard` or `xsel --clipboard`. If neither is installed, clipboard operations fail silently. Install with `sudo apt install xclip` (Debian/Ubuntu) or `sudo dnf install xclip` (Fedora).
|
|
152
|
+
- **Config location**: `~/.config/10x-cli/` (respects `$XDG_CONFIG_HOME` if set).
|
|
153
|
+
|
|
154
|
+
### macOS
|
|
155
|
+
|
|
156
|
+
- **Clipboard**: Skills use `pbcopy` — works out of the box.
|
|
157
|
+
- **Config location**: `~/.config/10x-cli/`.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Troubleshooting
|
|
162
|
+
|
|
163
|
+
When the user reports a problem, follow this sequence:
|
|
164
|
+
|
|
165
|
+
### 1. Run doctor first
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
10x doctor
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
This catches the most common issues. Read the output and address each failing check.
|
|
172
|
+
|
|
173
|
+
### 2. Common problems and fixes
|
|
174
|
+
|
|
175
|
+
| Symptom | Likely cause | Fix |
|
|
176
|
+
|---------|-------------|-----|
|
|
177
|
+
| "You're not signed in" | No auth or expired session | `10x auth` |
|
|
178
|
+
| "Session expired" | Token past expiry and auto-refresh failed | `10x auth` (re-login) |
|
|
179
|
+
| API unreachable / timeout | Network issue or API outage | Check internet; retry in a few minutes |
|
|
180
|
+
| "Module is locked" | Content not yet released | `10x list` to see unlock date |
|
|
181
|
+
| `.claude/` not found (doctor fail) | Running from wrong directory or wrong tool profile | `cd` to project root; check `10x doctor --json` for which tool is configured |
|
|
182
|
+
| "403 Forbidden" on `10x get` | Module locked or no membership | Check `10x list` for module state; verify enrollment |
|
|
183
|
+
| Orphaned artifact prompt on `get` | Switching tools mid-lesson | Choose "migrate" to move files, or "delete" to clean up |
|
|
184
|
+
| Permission denied writing files | Directory not writable | Check directory permissions; on POSIX: `chmod u+w <dir>` |
|
|
185
|
+
|
|
186
|
+
### 3. Verbose mode for deeper debugging
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
10x get m1l1 --verbose
|
|
190
|
+
10x doctor --verbose
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
This prints request/response diagnostics to stderr, useful for diagnosing API or network issues.
|
|
194
|
+
|
|
195
|
+
### 4. Nuclear reset
|
|
196
|
+
|
|
197
|
+
If config is corrupted:
|
|
198
|
+
|
|
199
|
+
On macOS/Linux:
|
|
200
|
+
```bash
|
|
201
|
+
rm -rf ~/.config/10x-cli
|
|
202
|
+
10x auth
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
On Windows (PowerShell):
|
|
206
|
+
```powershell
|
|
207
|
+
Remove-Item -Recurse -Force "$env:APPDATA\10x-cli"
|
|
208
|
+
10x auth
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
This clears auth and tool preference. The next `10x auth` recreates everything.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Important Principles
|
|
216
|
+
|
|
217
|
+
- **Answer with the user's OS and tool in mind.** Never show `pbcopy` to a Windows user. Never show `%APPDATA%` to a macOS user.
|
|
218
|
+
- **Run `10x doctor` before speculating.** It catches 80% of issues.
|
|
219
|
+
- **Don't guess command syntax from memory.** If unsure about a flag or behavior, fetch the latest README: `https://raw.githubusercontent.com/przeprogramowani/10x-cli/refs/heads/master/README.md`
|
|
220
|
+
- **Distinguish tool profile issues from CLI issues.** If artifacts land in the wrong directory, it is a tool profile question. If the command itself fails, it is a CLI/auth/network question.
|