Skip to content
Draft
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ cfl search --cql "space = DEV AND type = page"
# Copy a page
cfl page copy 123456 --title "Copy of Page"

# Export a page to PDF
cfl page export 123456 -O handoff.pdf

# Spaces
cfl space list
cfl space view DEV
Expand Down
17 changes: 17 additions & 0 deletions skills/Confluence/CliReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ cfl [resource] [action] [ID] [flags]
| `cfl page copy PAGE_ID --title "Copy" --no-labels` | Copy without labels |
| `cfl page delete PAGE_ID` | Delete page (with confirmation) |
| `cfl page delete PAGE_ID --force` | Delete without confirmation |
| `cfl page export PAGE_ID` | Export page as PDF (filename from the page title) |
| `cfl page export PAGE_ID -O handoff.pdf` | Export to a specific file |
| `cfl page export PAGE_ID --force` | Overwrite existing file without warning |
| `cfl page export PAGE_ID --timeout 10m` | Allow longer for a large page to render |

### Page Export Flags

| Flag | Short | Default | Description |
|------|-------|---------|-------------|
| `--format` | | `pdf` | Export format; `pdf` is the only value |
| `--output-file` | `-O` | (from page title) | Output file path |
| `--force` | `-f` | `false` | Overwrite existing file without warning |
| `--timeout` | | `5m` | How long to wait for Confluence to render |

Confluence renders the document server-side, so the command starts an export
task, polls it, and downloads the result once it finishes. Progress is written
to stderr; stdout carries only the success block.

### Create/Edit Flags

Expand Down
30 changes: 30 additions & 0 deletions skills/Confluence/Workflows/ManagePage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Create, edit, copy, move, and delete Confluence pages.
| "move page", "reparent" | Move | `cfl page edit PAGE_ID --parent NEW_PARENT_ID` |
| "copy page", "duplicate" | Copy | `cfl page copy PAGE_ID --title "Copy Title"` |
| "delete page", "remove page" | Delete | `cfl page delete PAGE_ID` |
| "export page", "save as PDF", "send it as a PDF" | Export | `cfl page export PAGE_ID` |

### Content Source Mapping (for create/edit)

Expand Down Expand Up @@ -131,11 +132,40 @@ Or do it as two explicit steps (capture ID from the table output, then edit).
cfl page delete PAGE_ID
```

### Export Page to PDF

Use this when a page has to leave Confluence as a document — an attachment to
send to someone outside the site, for instance.

```bash
# Filename comes from the page title
cfl page export PAGE_ID

# Name the file yourself
cfl page export PAGE_ID -O handoff.pdf

# Overwrite an existing file
cfl page export PAGE_ID -O handoff.pdf --force

# A large page can take longer to render
cfl page export PAGE_ID --timeout 10m
```

Confluence renders the PDF server-side, so the command waits on an export task
and reports completion on stderr while it does. Stdout carries only the success
block, so the path is scriptable:

```bash
# A title-derived filename can contain spaces, so take the rest of the line
PDF=$(cfl page export PAGE_ID 2>/dev/null | sed -n 's/^Exported: //p')
```

## Post-Action

After any action:
1. For creates: show the new page ID and confirm title/space
2. For edits: confirm what was changed (content, title, parent)
3. For copies: show the new page ID and location
4. For deletes: confirm which page was deleted
5. For exports: show the output path and size
5. For moves: confirm old and new parent
1 change: 1 addition & 0 deletions tools/cfl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Added

- `page export` command to export a page as a PDF, waiting on the server-side render and writing the result to a file
- Service account support with bearer auth (`--auth-method bearer`) for scoped API tokens ([#171](https://github.com/open-cli-collective/atlassian-cli/pull/171))
- Wiki-link syntax `[[Page Title]]` and `[[SPACE:Page Title]]` for internal Confluence page links ([#129](https://github.com/open-cli-collective/atlassian-cli/pull/129))
- `space view`, `space create`, `space update`, `space delete` commands for full space management ([#151](https://github.com/open-cli-collective/atlassian-cli/issues/151))
Expand Down
34 changes: 34 additions & 0 deletions tools/cfl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ A command-line interface for Atlassian Confluence Cloud, inspired by [jira-cli](
- **Markdown-first**: Write and view pages in markdown, auto-converted to/from Confluence format
- List and browse spaces
- Create, view, edit, copy, and delete pages
- Export a page to PDF
- Inspect page history and view specific page versions
- **Search content** using CQL (Confluence Query Language)
- Upload, download, list, and delete attachments
Expand Down Expand Up @@ -501,6 +502,39 @@ cfl page delete 12345 --force

---

### `cfl page export <page-id>`

Export a page as a PDF.

```bash
cfl page export 12345 # Filename from the page title
cfl page export 12345 -O handoff.pdf
cfl page export 12345 -O handoff.pdf --force
cfl page export 12345 --timeout 10m # Allow longer for a large page
```

| Flag | Short | Default | Description |
|------|-------|---------|-------------|
| `--format` | | `pdf` | Export format; `pdf` is the only supported value |
| `--output-file` | `-O` | (from page title) | Output file path |
| `--force` | `-f` | `false` | Overwrite existing file without warning |
| `--timeout` | | `5m` | How long to wait for Confluence to render the export |

**Arguments:**
- `<page-id>` - The page ID (**required**)

Confluence renders the PDF server-side, so the command starts an export task,
polls it until it finishes, and then downloads the result. Completion updates
go to stderr, leaving stdout to carry only the success block, so redirecting
stdout captures the two-line result and nothing else.

Without `--output-file` the page title names the file. Titles are free text and
can carry path separators, so the name is reduced to a single file in the
working directory, falling back to the page ID when a title leaves nothing
usable.

---

### `cfl search [query]`

Search for pages, blog posts, attachments, and comments across Confluence.
Expand Down
Loading
Loading