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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firecrawl-cli",
"version": "1.24.5",
"version": "1.24.6",
"publishConfig": {
"tag": "latest"
},
Expand Down
28 changes: 28 additions & 0 deletions src/__tests__/cli-aliases.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('CLI compatibility aliases', { timeout: 30000 }, () => {
global.fetch = () => { throw new Error('Unexpected network request'); };
const print = (value) => console.log(JSON.stringify(value));
require('./dist/commands/credit-usage').handleCreditUsageCommand = print;
require('./dist/commands/alexandria').handleAlexandria = (calls, options) => print({ calls, options });
const scrape = require('./dist/commands/scrape');
scrape.handleScrapeCommand = print;
scrape.handleAllScrapeCommand = (_url, options) => print(options);
Expand All @@ -37,6 +38,33 @@ describe('CLI compatibility aliases', { timeout: 30000 }, () => {
});
}

testWithBuiltCli(
'sql preserves experimental aliases and execution options',
() => {
const flags = ['SHOW CATEGORIES', '--execute', '--pretty'];
const canonical = run(['sql', ...flags]);
expect(canonical.status, canonical.stderr).toBe(0);
expect(JSON.parse(canonical.stdout)).toMatchObject({
calls: [
{
provider: 'firecrawl',
capability: 'sql',
options: { query: 'SHOW CATEGORIES', execute: true },
},
],
options: { pretty: true },
});
for (const prefix of [
['x', 'sql'],
['experimental', 'sql'],
]) {
const alias = run([...prefix, ...flags]);
expect(alias.status, alias.stderr).toBe(0);
expect(alias.stdout).toBe(canonical.stdout);
}
}
);

testWithBuiltCli(
'credits preserves credit-usage options and authentication',
() => {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,7 @@ Shorthand: "firecrawl x" is an alias for "firecrawl experimental".
`
);
experimental.addCommand(createDownloadCommand());
program.addCommand(createSqlCommand(), { hidden: true });
experimental.addCommand(createSqlCommand(), { hidden: true });
program.addCommand(experimental);

Expand Down
Loading