Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Comment thread
luna-moon-1216 marked this conversation as resolved.
## 0.5.4 - 2026-07-09

### Fixed
Expand Down
10 changes: 9 additions & 1 deletion skills/dx-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -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:*)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,8 +21,6 @@ import {

export async function run(argv = process.argv): Promise<void> {
try {
handleTemporaryBaseUrlMigration(argv);

const program = createProgram();
if (argv.length <= 2) {
program.outputHelp();
Expand Down
9 changes: 0 additions & 9 deletions src/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
}
});
70 changes: 0 additions & 70 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string | undefined>;

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(
Expand Down
Loading