diff --git a/CHANGELOG.md b/CHANGELOG.md index 2467c63..3627591 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Updated + +- The `dx-cli` skill now knows to answer general DX product questions — concepts, setup/admin procedures, connector configuration, and troubleshooting — by fetching DX's own documentation (`docs.getdx.com/llms.txt` for the page index, then each page's `.md` URL). Questions about the user's own data still go through the `dx` CLI commands. + +### Removed + +- Removed the temporary `baseUrl` → `apiBaseUrl`/`webBaseUrl` config migration. Users of managed DX deployments still on a pre-0.3.0 config should refer to the breaking changes in version `0.3.0` for re-authentication instructions. + ## 0.5.4 - 2026-07-09 ### Fixed diff --git a/skills/dx-cli/SKILL.md b/skills/dx-cli/SKILL.md index 3f014ca..88e35ff 100644 --- a/skills/dx-cli/SKILL.md +++ b/skills/dx-cli/SKILL.md @@ -1,6 +1,6 @@ --- name: dx-cli -description: Interact with the DX (getdx.com) APIs to get and manage information about the Software Catalog, manage Scorecards to track system health, analyze Snapshot survey results, and perform data analysis on Engineering productivity. +description: Interact with the DX (getdx.com) APIs to get and manage information about the Software Catalog, manage Scorecards to track system health, analyze Snapshot survey results, and perform data analysis on Engineering productivity. Also answers questions about DX itself — product concepts, setup/admin procedures (SSO, connectors, backfills), and troubleshooting — by fetching DX's own documentation. user-invocable: false compatibility: Requires access to the internet allowed-tools: Bash(dx:*) @@ -44,6 +44,14 @@ dx auth whoami This calls the `/auth.whoami` endpoint and displays the account name, token type, and (for personal access tokens) the user's name, email, and team with its lead and contributors. Organization tokens return `null` for `user` and `team`. +## Answering DX Product Questions + +Use this for any question about DX itself rather than the user's own data: product concepts ("what's the difference between a Scorecard and an Initiative?"), setup/admin procedures ("how do I set up Okta SSO?", "how do I backfill GitHub history?"), connector configuration ("how do I connect GitHub?"), or troubleshooting/FAQ ("why doesn't DX support X?"). Do not use it for questions about the user's own data (their entities, checks, scores, tasks) — use the `dx` CLI commands in this skill for those instead. + +1. Fetch `https://docs.getdx.com/llms.txt` for the index of documentation pages and their Markdown URLs. +2. Fetch the relevant page's `.md` URL directly, not the HTML page, e.g. `https://docs.getdx.com/onboarding/github-backfill.md`. +3. Answer from the fetched Markdown, not from memory. If the page contains a numbered or sequential procedure, follow those steps in the given order — don't skip ahead, reorder, or paraphrase a step away, whether you're relaying them to the user or executing them yourself. + ## Glossary ### Software Catalog terms diff --git a/src/cli.ts b/src/cli.ts index 0c92f1e..b3abdb7 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -12,7 +12,6 @@ import { workflowsCommand } from "./commands/workflows.js"; import { handleError } from "./commandHelpers.js"; import cliPackage from "../package.json" with { type: "json" }; -import { handleTemporaryBaseUrlMigration } from "./config.js"; import { checkForNewVersion, performUpdate, @@ -22,8 +21,6 @@ import { export async function run(argv = process.argv): Promise { try { - handleTemporaryBaseUrlMigration(argv); - const program = createProgram(); if (argv.length <= 2) { program.outputHelp(); diff --git a/src/config.test.ts b/src/config.test.ts index 020f5f2..ac3cabf 100644 --- a/src/config.test.ts +++ b/src/config.test.ts @@ -63,12 +63,3 @@ describe("readConfig", () => { expect(stored.webBaseUrl).toBe("https://app.example.com"); }); }); - -it("TIME BOMB TEST: remove the handleTemporaryBaseUrlMigration function after 2026-07-01", () => { - const now = new Date(); - if (now.getTime() > new Date("2026-07-01").getTime()) { - throw new Error( - "TIME BOMB TEST: handleTemporaryBaseUrlMigration function should be removed from the codebase after 2026-07-01", - ); - } -}); diff --git a/src/config.ts b/src/config.ts index e35cd3f..687b358 100644 --- a/src/config.ts +++ b/src/config.ts @@ -63,76 +63,6 @@ export function persistVersionPromptSelection( writeConfig(config); } -/** - * Responsible for handling the migration from `baseUrl` to `apiBaseUrl` and `webBaseUrl`, - * so the upgrade to 0.3.x will be non-breaking for `cloud` and `dedicated` deployments. - * - * `managed` deployments will encounter an error and will have to reauthenticate. - * - * TODO: delete after 2026-07-01. - */ -export function handleTemporaryBaseUrlMigration(argv: string[]): void { - if (!process.env.VITEST) { - // Running tests - we don't want our permanent tests to exercise this logic - return; - } - - const COMMANDS_TO_SKIP_MIGRATION = ["login", "logout", "init"]; - if (COMMANDS_TO_SKIP_MIGRATION.some((command) => argv.includes(command))) { - // Logging in or logging out: we need to ignore the current config file's contents - return; - } - - const configPath = getConfigPath(); - if (!fs.existsSync(configPath)) { - // No config file, no need to migrate - return; - } - - const content = fs.readFileSync(configPath, "utf8"); - const raw = JSON.parse(content) as Record; - - const api = raw.apiBaseUrl; - const web = raw.webBaseUrl; - - if (api !== undefined && web !== undefined) { - // Already migrated, no need to do anything - return; - } - - if (raw.baseUrl) { - // Legacy baseUrl is present, migrate to apiBaseUrl and webBaseUrl - - const apiBaseUrl = raw.baseUrl; - let webBaseUrl; - if (apiBaseUrl.endsWith(".getdx.com")) { - // Migrate `cloud` - webBaseUrl = "https://app.getdx.com"; - writeConfig({ - apiBaseUrl: normalizeUrl(apiBaseUrl), - webBaseUrl: normalizeUrl(webBaseUrl), - }); - return; - } - - const dedicatedMatch = apiBaseUrl.match(/^api\.(.+)\.getdx\.io$/); - if (dedicatedMatch) { - // Migrate `dedicated` - webBaseUrl = `https://${dedicatedMatch[1]}.getdx.io`; - writeConfig({ - apiBaseUrl: normalizeUrl(apiBaseUrl), - webBaseUrl: normalizeUrl(webBaseUrl), - }); - return; - } - - // Unable to automatically migrate `managed` - throw new CliError( - "Your on-disk DX CLI config is missing apiBaseUrl and webBaseUrl. Run `dx auth logout`, then login again via `dx init` or `dx auth login`.", - ); - } -} - export function writeConfig(config: StoredConfig): void { fs.mkdirSync(getConfigDir(), { recursive: true }); fs.writeFileSync(