diff --git a/package.json b/package.json index 8f41112e3..dfa197408 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/commands/version.ts b/src/commands/version.ts new file mode 100644 index 000000000..e6286de96 --- /dev/null +++ b/src/commands/version.ts @@ -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); +} diff --git a/src/index.ts b/src/index.ts index 042692768..0d1b4e292 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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(); @@ -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 ', 'Firecrawl API key (or set FIRECRAWL_API_KEY env var, or use "firecrawl config")' @@ -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);