llmstxt-cli 0.3.0 → 0.4.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/dist/index.js +5 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6404,7 +6404,7 @@ function resolveSlug(nameOrSlug) {
|
|
|
6404
6404
|
|
|
6405
6405
|
// src/lib/storage.ts
|
|
6406
6406
|
import { createHash } from "crypto";
|
|
6407
|
-
import {
|
|
6407
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync4, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
6408
6408
|
import { join as join4 } from "path";
|
|
6409
6409
|
|
|
6410
6410
|
// src/lib/agents.ts
|
|
@@ -6756,15 +6756,6 @@ function removeAgentSkill({ projectDir, slug, agent }) {
|
|
|
6756
6756
|
} catch {
|
|
6757
6757
|
}
|
|
6758
6758
|
}
|
|
6759
|
-
function getGitignoreEntries() {
|
|
6760
|
-
const dirs = /* @__PURE__ */ new Set([`${CANONICAL_DIR}/`]);
|
|
6761
|
-
for (const agent of agents) {
|
|
6762
|
-
if (!agent.isUniversal) {
|
|
6763
|
-
dirs.add(`${agent.skillsDir}/`);
|
|
6764
|
-
}
|
|
6765
|
-
}
|
|
6766
|
-
return [...dirs].sort();
|
|
6767
|
-
}
|
|
6768
6759
|
|
|
6769
6760
|
// src/lib/storage.ts
|
|
6770
6761
|
var LLMS_DIR = ".llms";
|
|
@@ -6862,30 +6853,6 @@ function isInstalled({ projectDir, slug }) {
|
|
|
6862
6853
|
sanitizeSlug(slug);
|
|
6863
6854
|
return existsSync3(join4(projectDir, CANONICAL_DIR, slug, "SKILL.md"));
|
|
6864
6855
|
}
|
|
6865
|
-
function addToGitignore(projectDir) {
|
|
6866
|
-
try {
|
|
6867
|
-
const gitignorePath = join4(projectDir, ".gitignore");
|
|
6868
|
-
const gitignoreEntries = [".llms/", ...getGitignoreEntries()];
|
|
6869
|
-
if (existsSync3(gitignorePath)) {
|
|
6870
|
-
const content = readFileSync3(gitignorePath, "utf-8");
|
|
6871
|
-
const missing = gitignoreEntries.filter((e) => !content.includes(e));
|
|
6872
|
-
if (missing.length === 0) return false;
|
|
6873
|
-
appendFileSync(gitignorePath, `
|
|
6874
|
-
# llms.txt documentation
|
|
6875
|
-
${missing.join("\n")}
|
|
6876
|
-
`);
|
|
6877
|
-
} else {
|
|
6878
|
-
writeFileSync3(gitignorePath, `# llms.txt documentation
|
|
6879
|
-
${gitignoreEntries.join("\n")}
|
|
6880
|
-
`);
|
|
6881
|
-
}
|
|
6882
|
-
return true;
|
|
6883
|
-
} catch (err) {
|
|
6884
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
6885
|
-
console.warn(`Could not update .gitignore: ${msg}`);
|
|
6886
|
-
return false;
|
|
6887
|
-
}
|
|
6888
|
-
}
|
|
6889
6856
|
|
|
6890
6857
|
// src/commands/info.ts
|
|
6891
6858
|
async function info(name) {
|
|
@@ -7290,7 +7257,7 @@ async function fetchLlmsTxt({ url, existingEtag }) {
|
|
|
7290
7257
|
|
|
7291
7258
|
// src/lib/telemetry.ts
|
|
7292
7259
|
var TELEMETRY_ENDPOINT = "https://llmstxt.directory/api/cli/telemetry";
|
|
7293
|
-
var CLI_VERSION = "0.
|
|
7260
|
+
var CLI_VERSION = "0.4.0";
|
|
7294
7261
|
var CI_ENV_VARS = ["CI", "GITHUB_ACTIONS", "GITLAB_CI", "CIRCLECI", "TRAVIS"];
|
|
7295
7262
|
function isDisabled() {
|
|
7296
7263
|
return process.env.DO_NOT_TRACK === "1" || process.env.LLMSTXT_TELEMETRY_DISABLED === "1";
|
|
@@ -7317,7 +7284,7 @@ function track(params) {
|
|
|
7317
7284
|
async function init(options) {
|
|
7318
7285
|
const projectDir = process.cwd();
|
|
7319
7286
|
const isInteractive = process.stdin.isTTY && !options.yes;
|
|
7320
|
-
printBanner("0.
|
|
7287
|
+
printBanner("0.4.0");
|
|
7321
7288
|
p3.intro("Install llms.txt documentation for your project");
|
|
7322
7289
|
const spin = spinner2("Loading registry...");
|
|
7323
7290
|
spin.start();
|
|
@@ -7593,9 +7560,6 @@ async function installEntries({
|
|
|
7593
7560
|
if (summaryLines.length > 0) {
|
|
7594
7561
|
p3.note(summaryLines.join("\n"), "Summary");
|
|
7595
7562
|
}
|
|
7596
|
-
if (addToGitignore(projectDir)) {
|
|
7597
|
-
p3.log.success("Added skill directories to .gitignore");
|
|
7598
|
-
}
|
|
7599
7563
|
if (installed > 0) {
|
|
7600
7564
|
syncClaudeMd(projectDir);
|
|
7601
7565
|
}
|
|
@@ -7743,7 +7707,6 @@ async function install({ names, options }) {
|
|
|
7743
7707
|
p4.note(lines.join("\n"), "Summary");
|
|
7744
7708
|
}
|
|
7745
7709
|
if (installed > 0) {
|
|
7746
|
-
addToGitignore(projectDir);
|
|
7747
7710
|
syncClaudeMd(projectDir);
|
|
7748
7711
|
}
|
|
7749
7712
|
if (failed > 0) {
|
|
@@ -7967,8 +7930,8 @@ async function update(name, options) {
|
|
|
7967
7930
|
|
|
7968
7931
|
// src/index.ts
|
|
7969
7932
|
var program = new Command();
|
|
7970
|
-
program.name("llmstxt").description("Install llms.txt files from the llms-txt-hub registry into your AI coding tools").version("0.
|
|
7971
|
-
printBanner("0.
|
|
7933
|
+
program.name("llmstxt").description("Install llms.txt files from the llms-txt-hub registry into your AI coding tools").version("0.4.0").action(() => {
|
|
7934
|
+
printBanner("0.4.0");
|
|
7972
7935
|
program.outputHelp();
|
|
7973
7936
|
});
|
|
7974
7937
|
program.command("init").description("Auto-detect dependencies and install matching llms.txt files").option("--category <categories>", "Filter by categories (comma-separated)").option("--all-categories", "Include all categories").option("--dry-run", "Preview without installing").option("--full", "Prefer llms-full.txt when available").option("-y, --yes", "Skip confirmation prompts").action(init);
|