brief

package module
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: MIT Imports: 2 Imported by: 0

README

brief

A single-binary CLI tool that detects a software project's toolchain, configuration, and conventions, then outputs a structured report.

brief answers the bootstrap questions every AI coding agent, new contributor, and CI pipeline faces: what language is this, how do I install dependencies, how do I run the tests, what linter is configured.

It does not score, grade, or judge. It reports facts.

Use with AI coding agents

Add this to your CLAUDE.md, agents.md, or equivalent agent instructions file:

Before starting work on this project, run `brief .` to understand the toolchain,
test commands, linters, and project conventions. If on a branch, also run
`brief diff` to see which parts of the toolchain are affected by your changes.

The agent will get back structured information about the project's language, package manager, test runner, linter, formatter, build tools, and more, so it doesn't have to guess or ask you. On a feature branch, brief diff narrows that down to just the tools relevant to what's been changed, so the agent knows which linters to run, which test frameworks matter, and which config files are in play.

To let Claude Code run brief without prompting for approval each time, add this to ~/.claude/settings.json:

{
  "permissions": {
    "allow": ["Bash(brief *)"]
  }
}

Install

brew install git-pkgs/git-pkgs/brief

Or with Go:

go install github.com/git-pkgs/brief/cmd/brief@latest

Or download a binary from releases.

Usage

brief [flags] [path | url]        Detect project toolchain
brief diff [flags] [ref1] [ref2]  Detect only what changed between refs
brief missing [flags] [path]      Show recommended tooling gaps
brief threat-model [flags] [path] Threat categories implied by detected stack
brief sinks [flags] [path]        Dangerous functions in detected tools
brief enrich [flags] [path]       Detect and enrich with external data
brief list tools                  All tools in the knowledge base
brief list ecosystems             Supported ecosystems
brief schema                      JSON output schema

Works on local paths, git URLs, and registry packages:

brief .                                       Local directory
brief /path/to/project                        Any local path
brief https://github.com/expressjs/express    Git URL (cloned to temp dir)
brief npm:express                             Registry package (resolved to source repo)
brief gem:rails
brief crate:serde
brief pypi:requests

Remote sources are shallow-cloned by default. Use --depth 0 for a full clone, --keep to preserve the clone, or --dir ./somewhere to clone into a specific directory.

JSON when piped, human-readable on a TTY. Force either with --json or --human. Use --category test to filter to a single category.

brief dev — /home/user/myproject

Language:        Go
Package Manager: Go Modules (go mod download)
                 Lockfile: go.sum
                 9 runtime (223 total)

Test:        go test (go test ./...)
Lint:        golangci-lint (golangci-lint run)  [.golangci.yml]
Format:      gofmt (gofmt -w .)
Docs:        pkgsite (go run golang.org/x/pkgsite/cmd/pkgsite@latest)
Build:       GoReleaser (goreleaser release --clean)  [.goreleaser.yaml]
Security:    govulncheck (govulncheck ./...)
CI:          GitHub Actions  [.github/workflows/]
Coverage:    go test -cover (go test -coverprofile=coverage.out ./...)
Dep Updates: Dependabot  [.github/dependabot.yml]

Style:       tabs (inferred)  LF
Layout:      cmd/

             OS: ubuntu-latest, macos-latest, windows-latest (CI matrix)

Resources:   README.md
Resources:   LICENSE (MIT)
Community:   CONTRIBUTING.md

Git:         branch main  71 commits
             origin: git@github.com:user/myproject.git

Lines:       9295 code  397 files (scc)

148.7ms  428 files checked  11/355 tools matched

Use --verbose to include homepage, docs, and repo links for each detected tool.

Diff

brief diff runs the same detection but filters the report to only show tools, languages, and configuration relevant to files that changed. Useful for understanding what a branch or PR touches in terms of toolchain.

brief diff                        Compare against default branch + uncommitted
brief diff main                   Compare main to HEAD + uncommitted
brief diff v1.0.0 v2.0.0         Compare between two refs

With no arguments it auto-detects the default branch from origin/HEAD, falling back to main or master. The output lists changed files and only the toolchain entries those files relate to: if you changed a .go file, you'll see Go and its tools but not Python. If you changed .golangci.yml, you'll see golangci-lint. If you changed go.mod, you'll see dependency information.

Same output format as brief -- JSON when piped, human-readable on a TTY.

Missing

brief missing checks which recommended tool categories are absent for the project's detected ecosystems. It compares what's detected against five categories every project benefits from: test, lint, format, typecheck, and docs.

brief missing .
brief missing --json .

For each gap it suggests the canonical tool for that ecosystem, with the command to run and a link to docs.

Detected: python

Missing recommended tooling:

  Test         No test tool configured
               Suggested: pytest (pytest)
               https://docs.pytest.org

  Lint         No lint tool configured
               Suggested: Ruff (ruff check .)
               https://docs.astral.sh/ruff/

  Format       No format tool configured
               Suggested: Black (black .)
               https://black.readthedocs.io/en/stable/

Tools built into the language runtime (go test, gofmt, cargo clippy, dart analyze, deno lint, etc.) are detected automatically when the language is present and won't show as missing.

Threat model

brief threat-model unions the threat categories implied by all detected tools. Each tool definition carries taxonomy tags from oss-taxonomy that classify what it does (web framework, ORM, template engine, HTTP client, etc). A mapping table in _threats.toml resolves those tags to CWE/OWASP threat categories. The output is fully deterministic -- no AI, no heuristics, just lookup.

brief threat-model .
brief threat-model --json .

A Rails project produces:

Detected: ruby
Stack:    ActiveRecord, Bundler, GitHub Actions, RSpec, Rails, RuboCop, Ruby

  auth_bypass        Authentication Bypass  [CWE-287 A07:2021]
                     via Rails

  csrf               Cross-Site Request Forgery  [CWE-352 A01:2021]
                     via Rails

  mass_assignment    Mass Assignment  [CWE-915 A08:2021]
                     via ActiveRecord

  sql_injection      SQL Injection  [CWE-89 A03:2021]
                     via ActiveRecord

  ssti               Server-Side Template Injection  [CWE-1336 A03:2021]
                     via Rails

  xss                Cross-Site Scripting  [CWE-79 A03:2021]
                     via Rails

Rails carries role:framework + layer:backend which fires the backend-framework mapping (XSS, CSRF, SSRF, open redirect, path traversal, auth bypass). It also carries function:templating which fires XSS and SSTI, and function:authentication which fires auth bypass and session fixation. ActiveRecord carries function:data-mapping which fires SQL injection and mass assignment. Tools with no taxonomy contribute nothing, so projects using only linters and formatters get an empty threat list.

Match is conjunctive: a tool must carry all of a mapping's tags to fire it. role:framework + layer:frontend fires a different (smaller) set than role:framework + layer:backend, so React and Express don't get the same threats.

Sinks

A "sink" in security analysis is a function where untrusted data ends up doing something dangerous -- executing a SQL query, rendering HTML, spawning a shell process, opening a file path. brief sinks collects these from all detected tools and outputs the combined set relevant to this project's stack, so you know what to grep for without reading every tool's documentation.

brief sinks .
brief sinks --json .
ActiveRecord:
  Arel.sql                 sql_injection        CWE-89
                           Marks string as safe SQL, bypassing protections
  find_by_sql              sql_injection        CWE-89
  where                    sql_injection        CWE-89
                           With string interpolation; safe with hash or parameterized array
  order                    sql_injection        CWE-89
                           Column name not parameterizable; allowlist instead

Rails:
  html_safe                xss                  CWE-79
                           Marks string as safe, bypassing ActionView output escaping
  redirect_to              open_redirect        CWE-601
                           When target is from params
  render inline:           ssti                 CWE-1336
                           Renders string as ERB template

Ruby:
  eval                     code_injection       CWE-95
  system                   command_injection    CWE-78
  Marshal.load             deserialization      CWE-502

Language definitions carry stdlib sinks (eval, system, pickle.loads, etc). Frameworks carry their own (html_safe, dangerouslySetInnerHTML, redirect_to). ORMs carry raw query escape hatches (find_by_sql, $queryRawUnsafe, Arel.sql). Notes indicate when only some forms of a method are dangerous.

The sink data covers 17 languages, 28 web frameworks, 17 ORMs, 15 HTTP clients, 13 template engines, 10 auth libraries, and more. The knowledge base carries over 700 sinks total.

Enrichment

brief enrich runs the same scan, then fetches metadata from external APIs about the project itself: what packages it publishes, their download counts and dependents, runtime end-of-life status, and OpenSSF Scorecard.

brief enrich .
brief enrich --json .
brief enrich --verbose .

Data sources: ecosyste.ms for published package metadata, endoflife.date for runtime lifecycle, OpenSSF Scorecard for repo security.

Resources

Alongside the toolchain, brief picks up the conventional documents that describe how a project is run. README, changelog, roadmap, license (with detected SPDX identifier), and agent instructions are reported at the top level. Everything else is grouped: legal covers copyright, NOTICE, DCO, and CLA files; community covers contributing guides, code of conduct, support, governance, maintainers, authors, CODEOWNERS, and DEI statements; security covers the security policy, threat model, and audit reports; metadata covers machine-readable files like FUNDING, CITATION.cff, publiccode.yml, codemeta.json, and .zenodo.json.

Matching is case-insensitive and checks the repo root first, then docs/, .github/, and .gitlab/. Paths in the output are repo-relative, so a funding file found under .github/ is reported as .github/FUNDING.yml rather than just the basename. In JSON the groups appear as nested objects under resources.legal, resources.community, resources.security, and resources.metadata.

What it detects

54 language ecosystems with 516 tool definitions across 20 categories.

Languages: Ada, C, C#, C++, COBOL, Clojure, Common Lisp, Crystal, D, Dart, Deno, Elixir, Elm, Emacs Lisp, Erlang, F#, Fortran, GDScript, Gleam, Go, Groovy, Haskell, Haxe, Java, JavaScript, Julia, Kotlin, Lua, Mojo, Nim, Nix, OCaml, Objective-C, Odin, PHP, Perl, Prolog, Python, R, Racket, Roc, Ruby, Rust, Scala, Scheme, Solidity, Swift, Tcl, TypeScript, V, VHDL, Verilog, Zig.

Package Managers: Alire, Bun, Bundler, Cabal, Cargo, CocoaPods, Composer, Conan, Conda, DUB, Deno Modules, Gleam Packages, Go Modules, Gradle, Haxelib, Maven, Mix, Nix Flakes, NuGet, PDM, Pipenv, Pkg, Poetry, Quicklisp, Shards, Swift Package Manager, Yarn, dotnet CLI, elm, fpm, npm, opam, pip, pnpm, pub, rebar3, sbt, uv, vcpkg.

Test: AVA, Alcotest, Artillery, Bats, Bruno, Catch2, Cucumber, Cypress, EUnit, ExUnit, Gatling, Ginkgo, Google Test, Hspec, Hurl, JUnit, Jasmine, Jest, Kotest, Lighthouse CI, Locust, MSW, Minitest, Mocha, Newman, PHPUnit, Pest, Playwright, REST Client, RSpec, ScalaTest, Selenium, Testify, Testing Library, Vitest, XCTest, axe-core, benchmark-ips, cargo test, clojure.test, criterion, crystal spec, dart test, deno test, dotnet test, gleam test, go test, hyperfine, k6, kotlin.test, pytest, pytest-benchmark, tape, testament, zig test.

Lint: Ameba, Biome, Checkstyle, Clippy, Credo, ESLint, Flake8, HLint, Husky, Lefthook, Overcommit, PHP_CodeSniffer, PMD, Pylint, Revive, Roslyn Analyzers, RuboCop, Ruff, ShellCheck, SpotBugs, Stylelint, SwiftLint, Vale, WartRemover, actionlint, clang-tidy, clj-kondo, commitlint, cspell, dart analyze, deno lint, detekt, elvis, golangci-lint, hadolint, markdownlint, oxlint, pre-commit, typos.

Format: Black, Ormolu, PHP CS Fixer, Prettier, Spotless, StandardRB, SwiftFormat, clang-format, cljfmt, crystal tool format, dart format, deno fmt, dotnet format, dprint, erlfmt, gleam format, gofmt, google-java-format, isort, ktlint, mix format, nimpretty, ocamlformat, rustfmt, scalafmt, yapf, zig fmt.

Typecheck: Dialyxir, Dialyzer, Flow, PHPStan, Pyright, Sorbet, Steep, mypy, tsc.

Docs: Docsify, Docusaurus, Dokka, Doxygen, ExDoc, Hugo, Javadoc, Jekyll, MkDocs, Nextra, Read the Docs, Redoc, Sphinx, Starlight, Storybook, Swagger UI, TypeDoc, VitePress, Yard, cargo doc, dart doc, deno doc, mdBook, phpDocumentor, pkgsite.

Build: Actix Web, AdonisJS, Angular, Astro, Authlib, Autotools, Axum, CMake, CarrierWave, Chi, Devise, Django, Dune, EJS, Echo, Electron, Eleventy, Ember.js, Express, Faraday, FastAPI, Fastify, Fiber, Flask, Flutter, Formidable, Foundry, FreeMarker, Gatsby, Gin, GoReleaser, Gson, Guzzle, HTTParty, Haml, Handlebars, Hardhat, Hono, Invoke, Jackson, Jinja2, Koa, Laravel, Less, Liquid, Mage, Make, Mako, Meson, Multer, Mustache, NestJS, Newtonsoft.Json, Next.js, NextAuth.js, Nokogiri, Nunjucks, Nuxt, OkHttp, OmniAuth, Ox, PHP LDAP, Parcel, Passport, Phoenix, PostCSS, Pug, PyCryptodome, PyJWT, PyYAML, Qwik, Rails, Rake, React, React Native, Remix, RestClient, Resty, Rocket, Rollup, Rspack, SWC, Sass, ShellJS, Shrine, Sinatra, Slim, SnakeYAML, SolidJS, Spring Boot, Svelte, SvelteKit, Symfony, Tailwind CSS, Tauri, Thymeleaf, Twig, UnoCSS, Vite, Vue, Webpack, XStream, aiohttp, axios, bcrypt, bcrypt-ruby, cross, crypto-js, cryptography, defusedxml, esbuild, execa, fast-xml-parser, golang-jwt, got, httpx, js-yaml, jsonwebtoken, ldap3, ldapjs, lxml, net-ldap, node-fetch, python-jose, python-multipart, requests, reqwest, ruamel.yaml, ruby-jwt, sh, tsup, undici, urllib3, xml2js.

Codegen: Buf, GraphQL Code Generator, OpenAPI, Protobuf, Thrift, Wire, ent, gRPC, mockgen, sqlc.

Database: ActiveRecord, Alembic, Atlas, Dbmate, Diesel, Drizzle, Ecto, Flyway, GORM, Goose, Knex.js, Liquibase, MikroORM, Mongoose, Peewee, Prisma, SQLAlchemy, SQLite, Sequel, Sequelize, Tortoise ORM, TypeORM, pgx, sqlx.

Security: Bandit, Brakeman, Grype, OWASP Dependency-Check, SOPS, Semgrep, Snyk, SonarQube, Trivy, TruffleHog, bundler-audit, cargo-audit, govulncheck, npm audit, osv-scanner, pip-audit.

CI: Azure Pipelines, Buildkite, CircleCI, Cloudflare Workers, Dagger, Drone, Earthly, Fly.io, GitHub Actions, GitLab CI, Jenkins, Netlify, Render, Travis CI, Vercel.

Container: Cloud Native Buildpacks, Dev Container, Docker, Docker Compose, Podman.

Infra: AWS CDK, Ansible, CloudFormation, Helm, Kubernetes, Kustomize, Packer, Pulumi, Serverless Framework, Terraform, Vagrant.

Monorepo: Bazel, Cargo workspaces, Go workspace, Lerna, Moon, Nx, Pants, Rush, Turborepo, Yarn workspaces, pnpm workspaces.

Environment: Flipper, JetBrains IDE, LaunchDarkly, Mise, Unleash, VS Code, Volta, asdf, direnv, dotenv, pyenv.

i18n: Crowdin, Fluent, FormatJS, Lingui, Rails i18n, Transifex, gettext, i18next, vue-i18n.

Release: Changesets, cargo-release, conventional-changelog, git-cliff, np, release-please, semantic-release, standard-version, twine.

Coverage: Codecov, Coveralls, Excoveralls, JaCoCo, Sentry, SimpleCov, c8, cargo-tarpaulin, coverage.py, go test -cover, nyc.

Dep Updates: Dependabot, Git Submodules, Renovate.

Run brief list tools for the full list.

How it works

Detection rules are data, not code. Each tool is defined in a TOML file under knowledge/, organized by ecosystem. Adding a new tool is a single TOML file with no Go code changes.

[tool]
name = "RSpec"
category = "test"
default = true
homepage = "https://rspec.info"
description = "BDD testing framework for Ruby"

[detect]
files = ["spec/", ".rspec"]
dependencies = ["rspec", "rspec-core"]

[commands]
run = "bundle exec rspec"
alternatives = ["rake spec", "rspec"]

[config]
files = [".rspec", "spec/spec_helper.rb"]

[taxonomy]
role = ["testing-framework"]
function = ["testing"]

[[security.sinks]]
symbol = "let!"
threat = "dos"
cwe = "CWE-400"
note = "Example only; RSpec doesn't actually have security sinks"

The default = true flag marks a tool as the canonical choice for its category in that ecosystem. The brief missing command uses this to suggest the right tool when a category is absent.

Tool definitions can carry two optional sections. [taxonomy] classifies what the tool does using terms from oss-taxonomy: role (framework, library, linter), function (api-development, templating, data-mapping), layer (backend, frontend, data-layer), domain (web-development, blockchain). These tags pass through to the JSON output and drive the threat-model command. [[security.sinks]] lists known dangerous methods with their CWE references, used by the sinks command. Both are optional and populated incrementally.

Detection uses five primitives: file/directory presence, dependency names from parsed manifests, file content matching, structured key existence (JSON/TOML), and ecosystem filtering to prevent cross-language false positives.

Library usage

The detection engine, knowledge base, and reporters are separate Go packages. Import them directly instead of shelling out to the binary:

import (
    "github.com/git-pkgs/brief"
    "github.com/git-pkgs/brief/kb"
    "github.com/git-pkgs/brief/detect"
    "github.com/git-pkgs/brief/report"
)

knowledgeBase, _ := kb.Load(brief.KnowledgeFS)
engine := detect.New(knowledgeBase, "/path/to/project")
r, _ := engine.Run()
report.JSON(os.Stdout, r)

Contributing

Adding a new tool: create a TOML file in the appropriate ecosystem directory under knowledge/, add test fixtures in testdata/, run go test ./....

Adding a new ecosystem: create a directory under knowledge/, add language.toml plus at least a package manager, test framework, and linter.

See CONTRIBUTING.md for detection primitives and category definitions.

License

MIT

Documentation

Overview

Package brief detects a software project's toolchain, configuration, and conventions, then outputs a structured report.

Index

Constants

This section is empty.

Variables

View Source
var KnowledgeFS embed.FS
View Source
var Version = "dev"

Version is set at build time via ldflags.

Functions

This section is empty.

Types

type Command

type Command struct {
	Run          string   `json:"run"`
	Alternatives []string `json:"alternatives,omitempty"`
	Source       Source   `json:"source"`
	InferredTool string   `json:"inferred_tool,omitempty"`
}

Command is a runnable command with provenance.

type Confidence

type Confidence string

Confidence indicates how reliable a detection signal is.

const (
	ConfidenceHigh   Confidence = "high"
	ConfidenceMedium Confidence = "medium"
	ConfidenceLow    Confidence = "low"
)

type DepInfo added in v0.2.0

type DepInfo struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
	PURL    string `json:"purl"`
	Scope   string `json:"scope,omitempty"` // "runtime", "development", "test", "build"
	Direct  bool   `json:"direct"`
}

DepInfo is a parsed dependency from a manifest file.

type Detection

type Detection struct {
	Name        string     `json:"name"`
	Category    string     `json:"category"`
	Confidence  Confidence `json:"confidence"`
	Command     *Command   `json:"command,omitempty"`
	ConfigFiles []string   `json:"config_files,omitempty"`
	Lockfile    string     `json:"lockfile,omitempty"`
	Homepage    string     `json:"homepage,omitempty"`
	Docs        string     `json:"docs,omitempty"`
	Repo        string     `json:"repo,omitempty"`
	Description string     `json:"description,omitempty"`
	Taxonomy    *Taxonomy  `json:"taxonomy,omitempty"`
}

Detection is a single detected tool or feature.

type EnrichmentInfo added in v0.2.0

type EnrichmentInfo struct {
	Repo       *RepoEnrichment        `json:"repo,omitempty"`
	Packages   []PublishedPackage     `json:"packages,omitempty"`
	RuntimeEOL map[string]*RuntimeEOL `json:"runtime_eol,omitempty"`
}

EnrichmentInfo holds metadata fetched from external sources about the project itself.

type GitInfo

type GitInfo struct {
	Branch        string            `json:"branch,omitempty"`
	DefaultBranch string            `json:"default_branch,omitempty"`
	Remotes       map[string]string `json:"remotes,omitempty"` // name -> URL
	CommitCount   int               `json:"commit_count,omitempty"`
}

GitInfo describes the git repository state.

type LayoutInfo

type LayoutInfo struct {
	SourceDirs    []string `json:"source_dirs,omitempty"` // e.g. ["src/", "lib/", "app/"]
	TestDirs      []string `json:"test_dirs,omitempty"`   // e.g. ["spec/", "test/"]
	MirrorsSource bool     `json:"mirrors_source,omitempty"`
}

LayoutInfo describes the project's file layout conventions.

type LineCount

type LineCount struct {
	TotalFiles int            `json:"total_files"`
	TotalLines int            `json:"total_lines"`
	ByLanguage map[string]int `json:"by_language,omitempty"`
	Source     string         `json:"source"` // "scc", "tokei", or "fallback"
}

LineCount holds line count information.

type MissingCategory added in v0.4.0

type MissingCategory struct {
	Category     string `json:"category"`
	Label        string `json:"label"`
	Ecosystem    string `json:"ecosystem"`
	Suggested    string `json:"suggested"`
	SuggestedCmd string `json:"suggested_cmd,omitempty"`
	Description  string `json:"description,omitempty"`
	Docs         string `json:"docs,omitempty"`
}

MissingCategory describes a tool category that has no detected tools despite the ecosystem having known tools for it.

type MissingReport added in v0.4.0

type MissingReport struct {
	Version    string            `json:"version"`
	Path       string            `json:"path"`
	Ecosystems []string          `json:"ecosystems"`
	Missing    []MissingCategory `json:"missing"`
}

MissingReport is the output of a brief missing analysis.

type PlatformInfo

type PlatformInfo struct {
	RuntimeVersionFiles map[string]string   `json:"runtime_version_files,omitempty"`
	CIMatrixVersions    map[string][]string `json:"ci_matrix_versions,omitempty"`
	CIMatrixOS          []string            `json:"ci_matrix_os,omitempty"`
}

PlatformInfo describes detected platforms and runtime versions.

type PublishedPackage added in v0.2.0

type PublishedPackage struct {
	Name                   string `json:"name"`
	Ecosystem              string `json:"ecosystem"`
	PURL                   string `json:"purl"`
	LatestVersion          string `json:"latest_version,omitempty"`
	License                string `json:"license,omitempty"`
	Description            string `json:"description,omitempty"`
	Downloads              int    `json:"downloads,omitempty"`
	DownloadsPeriod        string `json:"downloads_period,omitempty"`
	DependentPackagesCount int    `json:"dependent_packages_count,omitempty"`
	DependentReposCount    int    `json:"dependent_repos_count,omitempty"`
	RegistryURL            string `json:"registry_url,omitempty"`
}

PublishedPackage describes a package this repo publishes to a registry.

type RepoEnrichment added in v0.2.0

type RepoEnrichment struct {
	Scorecard     float64 `json:"scorecard,omitempty"`
	ScorecardDate string  `json:"scorecard_date,omitempty"`
}

RepoEnrichment holds metadata about the project's own repository.

type Report

type Report struct {
	Version         string                 `json:"version"`
	Path            string                 `json:"path"`
	DiffRef         string                 `json:"diff_ref,omitempty"`
	DiffCommits     []string               `json:"diff_commits,omitempty"`
	ChangedFiles    []string               `json:"changed_files,omitempty"`
	Languages       []Detection            `json:"languages"`
	PackageManagers []Detection            `json:"package_managers"`
	Scripts         []Script               `json:"scripts,omitempty"`
	Tools           map[string][]Detection `json:"tools"`
	Style           *StyleInfo             `json:"style,omitempty"`
	Layout          *LayoutInfo            `json:"layout,omitempty"`
	Platforms       *PlatformInfo          `json:"platforms,omitempty"`
	Resources       *ResourceInfo          `json:"resources,omitempty"`
	Git             *GitInfo               `json:"git,omitempty"`
	Lines           *LineCount             `json:"lines,omitempty"`
	Dependencies    []DepInfo              `json:"dependencies,omitempty"`
	Enrichment      *EnrichmentInfo        `json:"enrichment,omitempty"`
	Stats           Stats                  `json:"stats"`
}

Report is the complete output of a brief analysis.

type ResourceInfo

type ResourceInfo struct {
	Readme      string `json:"readme,omitempty"`
	Changelog   string `json:"changelog,omitempty"`
	Roadmap     string `json:"roadmap,omitempty"`
	License     string `json:"license,omitempty"`
	LicenseType string `json:"license_type,omitempty"`
	Agents      string `json:"agents,omitempty"`

	Legal     map[string]string `json:"legal,omitempty"`
	Community map[string]string `json:"community,omitempty"`
	Security  map[string]string `json:"security,omitempty"`
	Metadata  map[string]string `json:"metadata,omitempty"`
}

ResourceInfo describes project resource files. Paths are relative to the repository root.

func (*ResourceInfo) Empty added in v0.6.0

func (r *ResourceInfo) Empty() bool

Empty reports whether no resources were found.

func (*ResourceInfo) Group added in v0.6.0

func (r *ResourceInfo) Group(name string) map[string]string

Group returns the map for the named resource group, creating it if needed. Returns nil for unknown group names.

type RuntimeEOL added in v0.2.0

type RuntimeEOL struct {
	EOL       string `json:"eol,omitempty"` // date string or "true"/"false"
	Supported bool   `json:"supported"`
	LTS       bool   `json:"lts,omitempty"`
	Latest    string `json:"latest,omitempty"` // latest patch version
}

RuntimeEOL holds end-of-life status for a runtime version.

type Scope added in v0.4.3

type Scope = string

Scope indicates the dependency scope.

const (
	ScopeRuntime     Scope = "runtime"
	ScopeDevelopment Scope = "development"
	ScopeTest        Scope = "test"
	ScopeBuild       Scope = "build"
)

Scope values for DepInfo.

type Script

type Script struct {
	Name   string `json:"name"`
	Run    string `json:"run"`
	Source string `json:"source"` // e.g. "Makefile", "package.json"
}

Script is a project-defined task (Makefile target, package.json script, etc.).

type SinkEntry added in v0.5.0

type SinkEntry struct {
	Symbol string `json:"symbol"`
	Tool   string `json:"tool"`
	Threat string `json:"threat"`
	CWE    string `json:"cwe,omitempty"`
	Note   string `json:"note,omitempty"`
}

SinkEntry is a known dangerous function in a detected tool.

type SinkReport added in v0.5.0

type SinkReport struct {
	Version string      `json:"version"`
	Path    string      `json:"path"`
	Sinks   []SinkEntry `json:"sinks"`
}

SinkReport is the output of brief sinks.

type Source

type Source string

Source indicates where a detected command came from.

const (
	SourceProjectScript Source = "project_script"
	SourceKnowledgeBase Source = "knowledge_base"
	SourceConfigFile    Source = "config_file"
)

type StackEntry added in v0.5.0

type StackEntry struct {
	Name     string    `json:"name"`
	Taxonomy *Taxonomy `json:"taxonomy,omitempty"`
}

StackEntry is a detected tool that contributed to the threat model.

type Stats

type Stats struct {
	Duration     time.Duration `json:"-"`
	DurationMS   float64       `json:"duration_ms"`
	FilesChecked int           `json:"files_checked"`
	ToolsMatched int           `json:"tools_matched"`
	ToolsChecked int           `json:"tools_checked"`
}

Stats holds performance and coverage metrics from the detection run.

type StyleInfo

type StyleInfo struct {
	Indentation     string `json:"indentation,omitempty"`   // e.g. "2-space", "4-space", "tabs"
	IndentSource    string `json:"indent_source,omitempty"` // e.g. "editorconfig", "inferred"
	LineEnding      string `json:"line_ending,omitempty"`   // "LF" or "CRLF"
	TrailingNewline *bool  `json:"trailing_newline,omitempty"`
}

StyleInfo describes detected coding style conventions.

type Taxonomy added in v0.5.0

type Taxonomy struct {
	Role       []string `json:"role,omitempty"`
	Function   []string `json:"function,omitempty"`
	Layer      []string `json:"layer,omitempty"`
	Domain     []string `json:"domain,omitempty"`
	Audience   []string `json:"audience,omitempty"`
	Technology []string `json:"technology,omitempty"`
}

Taxonomy holds oss-taxonomy facet classifications carried through from the tool definition. Values are kebab-case term IDs.

type Threat added in v0.5.0

type Threat struct {
	ID           string   `json:"id"`
	CWE          string   `json:"cwe,omitempty"`
	OWASP        string   `json:"owasp,omitempty"`
	Title        string   `json:"title"`
	IntroducedBy []string `json:"introduced_by"`
	Note         string   `json:"note,omitempty"`
}

Threat is a threat category that applies to the project's stack.

type ThreatReport added in v0.5.0

type ThreatReport struct {
	Version    string       `json:"version"`
	Path       string       `json:"path"`
	Ecosystems []string     `json:"ecosystems"`
	Stack      []StackEntry `json:"stack"`
	Threats    []Threat     `json:"threats"`
}

ThreatReport is the output of brief threat-model.

Directories

Path Synopsis
cmd
brief command
Package detect implements the project detection engine.
Package detect implements the project detection engine.
Package kb loads and queries the embedded TOML knowledge base.
Package kb loads and queries the embedded TOML knowledge base.
Package remote resolves remote sources (git URLs, registry packages) to local directories for scanning.
Package remote resolves remote sources (git URLs, registry packages) to local directories for scanning.
Package report formats brief detection results for output.
Package report formats brief detection results for output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL