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
18 changes: 15 additions & 3 deletions app/cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ const (

trueString = "true"
supportsFederatedAuthAnnotation = "supportsFederatedAuth"

// cliReferenceURL is the generated reference for the commands in this
// repository. It is generated by app/cli/documentation and read there: the
// documentation site publishes the Enterprise Edition reference instead, so
// linking to it would send users to a page that documents other commands.
cliReferenceURL = "https://github.com/chainloop-dev/chainloop/blob/main/app/cli/documentation/cli-reference.md"
Comment thread
migmartri marked this conversation as resolved.
)

var telemetryWg sync.WaitGroup
Expand Down Expand Up @@ -104,8 +110,14 @@ func NewRootCmd(l zerolog.Logger) *cobra.Command {
logger = l

rootCmd := &cobra.Command{
Use: appName,
Short: "Chainloop Command Line Interface",
Use: appName,
Short: "Chainloop Command Line Interface",
// The generated reference for these commands is kept in this repository
// rather than published to the documentation site, so the link points at
// the file itself.
Long: `Chainloop Command Line Interface

Command reference: ` + cliReferenceURL,
SilenceErrors: true,
SilenceUsage: true,
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
Expand Down Expand Up @@ -459,7 +471,7 @@ var (
// Posthog API key and endpoint are not sensitive information, they represent Chainloop's
// Posthog instance. Both are overridable at build time with -X so anyone compiling the CLI
// can point it at their own instance, and telemetry can be turned off entirely with
// DO_NOT_TRACK=1. See https://docs.chainloop.dev/command-line-reference/cli-telemetry.
// DO_NOT_TRACK=1. See https://docs.chainloop.dev/cli/telemetry.
//
// The endpoint is compiled in and has no runtime override, so an installed binary reports
// wherever it was built to report. https://crb.chainloop.dev is therefore frozen on the
Expand Down
2 changes: 1 addition & 1 deletion app/cli/cmd/trace_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ The organization, project, workflow and require-trace values are saved to

// traceDocsURL is the guide covering what this command set up and what can be
// done with it, which is more than belongs in a command's own output.
const traceDocsURL = "https://docs.chainloop.dev/guides/chainloop-trace"
const traceDocsURL = "https://docs.chainloop.dev/ai-sessions"

// writeTraceInitSummary reports what the repository was set up with. It goes to
// stdout rather than through the logger because it is the command's result,
Expand Down
8 changes: 2 additions & 6 deletions app/cli/documentation/cli-reference.mdx → app/cli/documentation/cli-reference.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
title: Command Line Reference (OSS)
---
# Command Line Reference (OSS)

<Note>
[The Enterprise Edition CLI](/command-line-reference/cli-ee-reference) provides additional platform management features, available with [paid plans](https://chainloop.dev/pricing).
</Note>
> [The Enterprise Edition CLI](https://docs.chainloop.dev/cli/reference) provides additional platform management features, available with [paid plans](https://chainloop.dev/pricing).

Chainloop CLI is a command-line tool designed to streamline the process of crafting, managing, and storing software supply chain attestations. The CLI enables developers to generate and submit evidence-such as build artifacts, SBOMs,
and vulnerability reports-directly from their CI/CD workflows, ensuring compliance with organizational policies without introducing friction into the development process.
Expand Down
18 changes: 10 additions & 8 deletions app/cli/documentation/generate.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2025 The Chainloop Authors.
// Copyright 2025-2026 The Chainloop Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,13 +30,12 @@ import (
"github.com/spf13/cobra/doc"
)

const fileHeader = `---
title: Command Line Reference (OSS)
---
// fileHeader is plain Markdown rather than MDX: this reference is read in the
// repository, not published to the documentation site, so it carries its own
// title instead of front matter and links out with absolute URLs.
const fileHeader = `# Command Line Reference (OSS)

<Note>
[The Enterprise Edition CLI](/command-line-reference/cli-ee-reference) provides additional platform management features, available with [paid plans](https://chainloop.dev/pricing).
</Note>
> [The Enterprise Edition CLI](https://docs.chainloop.dev/cli/reference) provides additional platform management features, available with [paid plans](https://chainloop.dev/pricing).

Chainloop CLI is a command-line tool designed to streamline the process of crafting, managing, and storing software supply chain attestations. The CLI enables developers to generate and submit evidence-such as build artifacts, SBOMs,
and vulnerability reports-directly from their CI/CD workflows, ensuring compliance with organizational policies without introducing friction into the development process.
Expand Down Expand Up @@ -68,7 +67,10 @@ func main() {
formatted := processFinalDocument(builder.String())
withHeader := fmt.Sprintf("%s%s", fileHeader, formatted)

err := os.WriteFile(filepath.Join(out, "cli-reference.mdx"), []byte(withHeader), 0600)
// The output directory is the argument in this file's go:generate directive,
// not anything a user of the CLI controls.
// nolint:gosec
err := os.WriteFile(filepath.Join(out, "cli-reference.md"), []byte(withHeader), 0600)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/policies/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This quickstart guide walks you through creating and validating a basic Chainloo

## Documentation References

- **CLI Reference**: [chainloop policy develop commands](https://docs.chainloop.dev/command-line-reference/cli-reference#chainloop-policy)
- **CLI Reference**: [chainloop policy develop commands](https://docs.chainloop.dev/cli/reference#chainloop-policy)
- **Policy Concepts**: [Understanding Chainloop Policies](https://docs.chainloop.dev/concepts/policies)
- **Custom Policy Guide**: [Writing Custom Policies](https://docs.chainloop.dev/guides/custom-policies)
- **Material Types**: [Available Material Types](https://docs.chainloop.dev/concepts/material-types#material-types)
Expand Down
Loading