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": "0.0.3",
"version": "0.0.4",
"description": "Command-line interface for Firecrawl. Scrape, crawl, and extract data from any website directly from your terminal.",
"main": "dist/index.js",
"bin": {
Expand Down
13 changes: 13 additions & 0 deletions src/commands/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Version command implementation
* Displays the CLI version
*/

import packageJson from '../../package.json';

/**
* Display version information
*/
export function handleVersionCommand(): void {
console.log(packageJson.version);
}
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import { configure } from './commands/config';
import { handleCreditUsageCommand } from './commands/credit-usage';
import { handleCrawlCommand } from './commands/crawl';
import { handleMapCommand } from './commands/map';
import { handleVersionCommand } from './commands/version';
import { isUrl, normalizeUrl } from './utils/url';
import { parseScrapeOptions } from './utils/options';
import { isJobId } from './utils/job';
import packageJson from '../package.json';

// Initialize global configuration from environment variables
initializeConfig();
Expand All @@ -24,7 +26,7 @@ const program = new Command();
program
.name('firecrawl')
.description('CLI tool for Firecrawl web scraping')
.version('1.0.0')
.version(packageJson.version)
.option(
'-k, --api-key <key>',
'Firecrawl API key (or set FIRECRAWL_API_KEY env var, or use "firecrawl config")'
Expand Down Expand Up @@ -287,6 +289,13 @@ program
await handleCreditUsageCommand(options);
});

program
.command('version')
.description('Display version information')
.action(() => {
handleVersionCommand();
});

// Parse arguments
const args = process.argv.slice(2);

Expand Down