Advanced docmgr workflows for importing external files, configuring custom roots, and maintaining documentation workspaces.
This guide covers advanced docmgr workflows that most users encounter after they've mastered the basics. These features solve specific problems: importing external research artifacts, debugging configuration issues, reorganizing legacy ticket structures, and managing multi-repo documentation setups.
When to read this:
.ttmp.yaml configuration worksPrerequisites:
docmgr help how-to-use)Third-party specs, customer notes, or LLM brainstorms rarely live inside docmgr at first. docmgr import file captures those artifacts in your ticket so reviewers can see exactly which research you referenced without digging through drives or chat logs.
# Import a markdown brainstorm from /tmp
docmgr import file --ticket MEN-4242 --file /tmp/chat-llm-notes.md
# Import a PDF spec and rename it on the way in
docmgr import file --ticket MEN-4242 \
--file ~/Downloads/websocket-spec.pdf \
--name websocket-spec-v2
ttmp/.../MEN-4242--.../sources/local/. The --name flag changes the basename while keeping the original extension..meta/sources.yaml records every import (type, original path, timestamp) so you can refresh or replace them later.index.md automatically gains an ExternalSources entry such as local:websocket-spec-v2.pdf, making the attachment searchable via docmgr doc search --external-source.sources/local/... inside the design/reference doc that consumes the material so reviewers know where supporting evidence lives.docmgr doc relate on the design doc or ticket index, noting that it depends on the imported file.docmgr import file ... --name existing-name (or delete + import) and mention the update in changelog.md.When importing large bundles (LLM dumps, screenshots, transcripts), add a short sources/README.md summarizing each file and why it matters. Treat it like an appendix so newcomers can skim before opening the raw assets.
docmgr searches for the docs root in this order:
--root flag (if provided)DOCMGR_CONFIG environment variable pointing to .ttmp.yaml.ttmp.yaml file (walking up from current directory)/ttmp (if in a Git repo)/ttmp (fallback)Create at repository root:
root: ttmp
vocabulary: ttmp/vocabulary.yaml
Use cases:
docs/ instead of ttmp/)Most users don't need this — defaults work for typical single-repo setups.
When docmgr behaves as if it's reading the wrong root or vocabulary, use docmgr config show to see the entire resolution process:
# Show config resolution from the current directory
docmgr config show
# Point at another docs root (useful in scripts/CI)
docmgr config show --root /tmp/doc-workspace/ttmp
# Combine with a custom config file
DOCMGR_CONFIG=../configs/docs/.ttmp.yaml docmgr config show
The output lists every source checked (CLI flag, DOCMGR_CONFIG, .ttmp.yaml while walking up, Git-root fallback) and clearly marks the source that was actually used, along with the effective root/vocabulary paths.
Common issues:
.ttmp.yaml.ttmp.yaml files in parent directories (first one found wins)Legacy tickets or manual file moves can leave documents sitting at the ticket root, which breaks the "one folder per doc-type" structure and makes templates hard to reuse. docmgr doc layout-fix rescans the ticket, moves each markdown file into the directory that matches its DocType, and updates internal links in one shot.
# Preview what would move (recommended)
docmgr doc layout-fix --ticket MEN-4242 --dry-run
# Apply the fix
docmgr doc layout-fix --ticket MEN-4242
What it does:
DocType frontmatter from each markdown file<doc-type>/ subdirectories (e.g., design-doc/, reference/)index.md, README.md, tasks.md, changelog.md)When to use:
Caution: When not using --ticket, it walks the entire docs root—handy after large migrations, but start with a dry run so the move list is readable.
Multiple repositories sharing a centralized documentation workspace:
/home/team/docs/
├── .ttmp.yaml # Shared config
├── ttmp/
│ ├── vocabulary.yaml
│ ├── PROJ-001-.../ # From repo A
│ └── PROJ-002-.../ # From repo B
In each repository's .ttmp.yaml:
root: /home/team/docs/ttmp
vocabulary: /home/team/docs/ttmp/vocabulary.yaml
monorepo/
├── .ttmp.yaml # Points to shared vocabulary
├── backend/
│ └── ttmp/ # Backend docs
├── frontend/
│ └── ttmp/ # Frontend docs
└── shared-vocabulary.yaml
Root .ttmp.yaml:
vocabulary: shared-vocabulary.yaml
When working in backend/:
cd backend
docmgr status # Uses backend/ttmp automatically
When working in frontend/:
cd frontend
docmgr status # Uses frontend/ttmp automatically
If you prefer docs/ instead of ttmp/:
root: docs
vocabulary: docs/vocabulary.yaml
All docmgr commands will now look for docs/ instead of ttmp/.
Configuration:
.ttmp.yaml when working across multiple reposdocmgr config show from different directories to verify discoveryImports:
sources/README.md when importing multiple files--name to give imports meaningful names.meta/sources.yaml if you manually refresh filesMaintenance:
layout-fix --dry-run before applying to preview changesconfig show when debugging unexpected behavior.ttmp.yaml in version controlNumeric prefixes keep long directories readable (01-overview.md, 02-api.md, …). docmgr adds them automatically when you scaffold new docs, but deletes, renames, and bulk moves can knock the ordering out of sync.
What happens automatically:
01-, 02-, 03-index.md, tasks.md, changelog.md) are exemptdocmgr doc renumberRun the renumber command whenever you:
# Resequence every doc under a ticket and fix references
docmgr doc renumber --ticket MEN-4242
docmgr doc renumber walks every doc-type directory, renames files to the next sequential prefix (switching to 3 digits once you exceed 99 files), and updates all markdown links inside the ticket so nothing breaks. Commit or stash unrelated changes first—the command edits every file that still references old paths.
No
--dry-runflag yet, so lean on Git to preview the diff if you need to approve the rename list.
Doctor warns if files are missing prefixes (you can suppress with .docmgrignore).
docmgr help how-to-use — Core tutorialdocmgr help ci-automation — CI/CD integration patternsdocmgr help how-to-setup — Initial setup guide