* feat: select org
* feat: make it possible to use org by slug
* improv: clean up
* fix: types
* improv: comment
* fix: add discriminator
* improv: comment
* fix: types
* improv: clean up
* test: org flag
* improv: clean up
* fix: test
* improv: clean up
* Update src/shared-options.ts
Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
---------
Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
Add --silent flag to headless mode (-p/--print) that removes <think></think>
tags and excess whitespace from LLM responses. This enables clean output
suitable for shell piping and automation.
## Why --silent instead of --no-think
The flag was renamed from --no-think to --silent because:
- Commander.js treats --no- prefix as negation flags, expecting a base --think option
- --silent provides clearer semantic meaning for "quiet, clean output"
- Follows Unix convention where --silent typically means suppress extra output
## Problem Solved
Many models (like Nemotron - Llama 3.3 Nemotron Super 49B v1.5) emit <think></think>
tags that interfere with shell piping:
Without --silent:
```
$ cn -p "Echo a shell script that prints 'Hello World' Output only the script and NOTHING ELSE. No code fences. No markdown."
<think>
I need to write a shell script. Let me think about this.
The user wants a simple Hello World script.
</think>
#\!/bin/bash
echo "Hello World"
```
With --silent:
```
$ cn -p --silent "Echo a shell script that prints 'Hello World' Output only the script and NOTHING ELSE. No code fences. No markdown."
#\!/bin/bash
echo "Hello World"
```
This makes piping work correctly:
```
$ eval $(cn -p --silent "Write a shell script that prints 'Hello World'")
Hello World
```
## Features
- Strips all <think></think> blocks and their content
- Reduces excessive whitespace (3+ consecutive newlines become 2)
- Works with --format json flag
- Includes comprehensive unit and e2e tests
- Only available with -p/--print flag (headless mode)
- Created adapter-mocks.ts to mock at the @continuedev/openai-adapters level
- Added minimal headless mode tests that verify basic CLI functionality
- Tests mock at the adapter interface rather than specific API endpoints
- All 4 minimal tests passing: version, help, error handling, config loading