Commit graph

38 commits

Author SHA1 Message Date
Nate
51932485ce fix: tests 2025-08-15 19:46:19 -07:00
Nate
502f49f8df fix: make sure that anthropic api key only works 2025-08-10 22:29:23 -04:00
Tomasz Stefaniak
fda6c3b508 fix: formatting 2025-08-08 13:05:40 -07:00
Tomasz Stefaniak
a96170cef8
Add --org flag to headless mode to allow org selection (#166)
* 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>
2025-08-08 12:50:54 -07:00
Tomasz Stefaniak
1fee6fe16f improv: lint 2025-08-05 14:06:08 -07:00
Nate Sesti
8cfc2f0965
Merge pull request #146 from continuedev/standardize-services-actual
refactor: base service class + migrate to vitest
2025-08-03 18:47:36 -07:00
Nate
c621961f8d refactor: base service class + migrate to vitest 2025-08-02 19:17:46 -04:00
Chad Metcalf
8fa31ed082
feat: add --silent flag to strip thinking tags from headless output
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)
2025-08-01 10:36:01 -07:00
Nate
1fcaa0ed20 fixes 2025-07-31 11:24:16 -07:00
Nate
62370d46e0 Merge branch 'main' into plan-mode 2025-07-31 11:08:21 -07:00
Nate
ce6a5f2f5a fix lint errors 2025-07-31 11:00:46 -07:00
Nate
4e12633a41 Improve piped input handling in headless mode - combine stdin with prompt args 2025-07-30 09:25:34 -07:00
Nate Sesti
8e44284927
Merge pull request #104 from continuedev/json-mode
feat: json headless mode
2025-07-29 22:16:40 -07:00
Nate
32c4abf8e9 Add validation for missing prompt in headless mode with -p flag 2025-07-29 15:23:40 -07:00
Nate
27f09a53cd fix tests 2025-07-28 13:16:20 -07:00
Nate
2e69b7d45e Merge branch 'main' into json-mode 2025-07-28 10:17:55 -07:00
Nate
2c9aa12c61 feat: json headless mode 2025-07-27 21:47:26 -07:00
Nate
5a77fc8410 feat: permissions.yaml 2025-07-27 13:24:29 -07:00
Nate
05941d8e82 fix some tests 2025-07-27 10:57:40 -07:00
Nate
2d285d02ce refactor: make config loading logic more readable 2025-07-24 21:11:50 -07:00
Nate
5a3f0ed794 fix local config loadign 2025-07-23 21:39:10 -07:00
Nate
606a50311d tests for config switching 2025-07-23 19:21:06 -07:00
Nate
5d8834d861 fix tests 2025-07-21 09:39:37 -07:00
Nate
7d4c6d9e5c fix piping to --print mode 2025-07-20 22:37:49 -07:00
Nate
11b7a99d01 fix tests 2025-07-20 17:39:12 -07:00
Nate
7cb028739c e2e tests spec 2025-07-20 17:04:11 -07:00
Nate
cc735dcb74 remove windows debuggin 2025-07-20 16:32:11 -07:00
Nate
f4d3aa1a60 more diagnostics 2025-07-19 23:32:16 -07:00
Nate
48090f52ae try to fix windows tests 2025-07-19 20:22:22 -07:00
Nate
54d4c44822 Revert "attempt to fix tests"
This reverts commit 8ff750dbfd.
2025-07-19 19:02:41 -07:00
Nate
8ff750dbfd attempt to fix tests 2025-07-19 18:59:46 -07:00
Nate
5853c38a54 clean up tests 2025-07-19 18:31:18 -07:00
Nate
0985597b43 fix tests 2025-07-19 18:28:36 -07:00
Nate
26ab6afda6 tests for headless mode 2025-07-19 18:10:16 -07:00
Nate
8607a06dc4 try to fix on windows 2025-07-19 15:22:29 -07:00
Nate
b9645c9911 e2e tests 2025-07-19 14:41:11 -07:00
Nate
15bbfdd42f test: add minimal headless mode E2E tests with adapter-level mocking
- 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
2025-07-18 19:46:06 -07:00
Nate
6623342a3b some more e2e tests 2025-07-18 19:22:27 -07:00