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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '24'
run: pnpm run lint

- name: Run unit tests
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '24'
run: pnpm test

- name: Test CLI execution (Unix)
if: runner.os != 'Windows'
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pids
# Dependency directories
node_modules/
jspm_packages/
.pnpm-store/

# TypeScript cache
*.tsbuildinfo
Expand Down
44 changes: 30 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ npx create-c1-app my-thesys-project --template template-c1-component-next --api-

## CLI Options

| Option | Alias | Description | Default |
| --------------------- | ----- | ------------------------------------------------------------------------------------------------------ | ----------------------- |
| `[project-name]` | | Name of the project to create (positional argument) | Interactive prompt |
| `--project-name` | `-n` | Name of the project to create (alternative to positional argument) | Interactive prompt |
| `--template` | `-t` | Next.js template to use (`template-c1-component-next` or `template-c1-next`) | Interactive prompt |
| `--api-key` | `-k` | Thesys API key to use for the project | Interactive prompt |
| `--debug` | `-d` | Enable debug logging | `false` |
| `--non-interactive` | | Run without prompts; fails fast if required options are missing. Auto-enabled in CI or non-TTY shells. | `false` (auto-detected) |
| `--disable-telemetry` | | Disable anonymous telemetry for current session | `false` |
| Option | Alias | Description | Default |
| --------------------- | ----- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------- |
| `[project-name]` | | Name of the project to create (positional argument) | Interactive prompt |
| `--project-name` | `-n` | Name of the project to create (alternative to positional argument) | Interactive prompt |
| `--template` | `-t` | Next.js template to use (`template-c1-component-next` or `template-c1-next`) | Interactive prompt |
| `--api-key` | `-k` | Thesys API key to use for the project | Interactive prompt |
| `--auth` | | Authentication method (`oauth`, `manual`, `skip`) | Prompt in interactive mode; `oauth` when provided |
| `--skip-auth` | | **Deprecated**. Use `--auth skip` instead | `false` |
| `--debug` | `-d` | Enable debug logging | `false` |
| `--non-interactive` | | Run without prompts; fails fast if required options are missing. Auto-enabled in non-TTY shells. | `false` (auto-detected) |
| `--disable-telemetry` | | Disable anonymous telemetry for current session | `false` |

## Usage Examples

Expand Down Expand Up @@ -93,14 +95,16 @@ pnpm link

## Authentication Options

Create C1 App supports two authentication methods:
Create C1 App supports flexible authentication methods:

### Option 1: OAuth 2.0 Authentication (Recommended)

The CLI will automatically open your browser and guide you through the OAuth authentication process:
The CLI will automatically open your browser and guide you through the OAuth authentication process. This is the default in interactive mode.

```bash
npx create-c1-app
# or explicitly:
npx create-c1-app --auth oauth
```

This method will:
Expand All @@ -109,20 +113,32 @@ This method will:
- Generate an API key automatically after successful login
- Store the API key in your project's `.env` file

If you do not pass an auth option in interactive mode, the CLI will ask you to choose between OAuth, manual API key entry, or skip.

### Option 2: Manual API Key

If you prefer to provide your API key manually or skip OAuth authentication:
If you prefer to enter your API key manually:

```bash
npx create-c1-app --skip-auth
npx create-c1-app --auth manual
```

Or provide your existing API key directly:
Or provide your existing API key directly via flag:

```bash
npx create-c1-app --api-key your-api-key-here
```

### Option 3: Skip Authentication

To skip authentication and API key generation (useful for testing or CI where you might set the key later):

```bash
npx create-c1-app --auth skip
```

_Note: The `--skip-auth` flag is deprecated but still supported for backward compatibility. Use `--auth skip` going forward._

## Getting Your Thesys API Key (Manual Method)

To get an API key manually:
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-c1-app",
"version": "1.2.6",
"version": "1.3.0",
"description": "A CLI tool that creates C1 projects with API authentication",
"type": "module",
"main": "dist/index.js",
Expand All @@ -12,6 +12,8 @@
"build": "tsc",
"dev": "node --loader ts-node/esm src/index.ts --debug --disable-telemetry",
"start": "node bin/create-c1-app.js",
"test": "vitest run",
"test:watch": "vitest",
"prepublishOnly": "npm run build",
"lint": "eslint 'src/**/*.ts' 'bin/create-c1-app.js'",
"lint:fix": "eslint 'src/**/*.ts' 'bin/create-c1-app.js' --fix"
Expand All @@ -37,7 +39,6 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/jest": "^29.5.8",
"@types/node": "^20.10.0",
"@types/unzipper": "^0.10.9",
"@types/validate-npm-package-name": "^4.0.2",
Expand All @@ -50,7 +51,8 @@
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-promise": "^6.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2"
"typescript": "^5.3.2",
"vitest": "^4.0.18"
},
"engines": {
"node": ">=20.9.0"
Expand Down
Loading