Skip to content

cscli: add --quick flag to enroll command#4350

Merged
blotus merged 14 commits intomasterfrom
cscli-auto-enroll
Apr 15, 2026
Merged

cscli: add --quick flag to enroll command#4350
blotus merged 14 commits intomasterfrom
cscli-auto-enroll

Conversation

@blotus
Copy link
Copy Markdown
Member

@blotus blotus commented Mar 3, 2026

Allow enrolling an instance in the console without providing a key.

When using the --auto flag, an URL will be returned by CAPI the user will need to visit in their browser to automatically enroll the instance in their account.

The default name of an instance is also changed to the hostname of the machine.

[Do not merge until CAPI support has been deployed]

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

@blotus: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

@blotus: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@blotus blotus marked this pull request as draft March 3, 2026 15:24
@blotus
Copy link
Copy Markdown
Member Author

blotus commented Mar 3, 2026

/kind enhancement
/area cscli

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 34.61538% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.51%. Comparing base (b0f5245) to head (bd6745a).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cmd/crowdsec-cli/cliconsole/console.go 24.32% 27 Missing and 1 partial ⚠️
pkg/apiclient/auth_service.go 60.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4350      +/-   ##
==========================================
- Coverage   63.58%   63.51%   -0.07%     
==========================================
  Files         476      476              
  Lines       33801    33841      +40     
==========================================
+ Hits        21492    21495       +3     
- Misses      10176    10209      +33     
- Partials     2133     2137       +4     
Flag Coverage Δ
bats 46.73% <18.36%> (-0.06%) ⬇️
unit-linux 36.53% <15.38%> (-0.07%) ⬇️
unit-windows 25.32% <18.36%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blotus blotus modified the milestone: 1.7.8 Apr 13, 2026
@blotus blotus marked this pull request as ready for review April 14, 2026 13:21
@blotus blotus changed the title cscli: add --auto flag to enroll command cscli: add --quick flag to enroll command Apr 15, 2026
Comment thread cmd/crowdsec-cli/cliconsole/console.go Outdated
return nil
if rawResp.Response.StatusCode == http.StatusOK {
if autoEnroll {
log.Warn("Instance already enrolled. Please visit https://app.crowdsec.net if you wish to move it to another account.")
Copy link
Copy Markdown
Contributor

@buixor buixor Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instance is already enrolled in an organisation; transfer it using https://app.crowdsec.net/.

Comment thread cmd/crowdsec-cli/cliconsole/console.go Outdated
}

if autoEnroll {
log.Infof("Please visit the following URL to enroll your instance: %s", autoResp.Url)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make url bold

Comment thread cmd/crowdsec-cli/cliconsole/console.go Outdated
You can get your enrollment key by creating an account on https://app.crowdsec.net.
After running this command your will need to validate the enrollment in the webapp.`,
Example: fmt.Sprintf(`cscli console enroll YOUR-ENROLL-KEY
cscli console enroll --auto
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick

@blotus blotus merged commit 7d4daef into master Apr 15, 2026
16 checks passed
@blotus blotus deleted the cscli-auto-enroll branch April 15, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cscli kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants