Search
Search
Section titled “Search”Search Confluence content using CQL (Confluence Query Language).
Prerequisites
Section titled “Prerequisites”- Authenticated profile (
atlcli auth login) - Space permission: View permission on spaces to search
Quick Start
Section titled “Quick Start”# Search by textatlcli wiki search "API documentation"
# Search in spaceatlcli wiki search "API" --space TEAM
# Search by labelatlcli wiki search --label apiRecent Pages
Section titled “Recent Pages”Quick access to recently modified pages:
# Last 7 days (default)atlcli wiki recent
# Last 30 daysatlcli wiki recent --days 30
# Filter by spaceatlcli wiki recent --space TEAM
# Filter by labelatlcli wiki recent --label api
# Limit resultsatlcli wiki recent --limit 50The wiki recent command generates CQL like:
type = page AND lastModified >= now("-7d") ORDER BY lastModified DESCMy Pages
Section titled “My Pages”Quick access to pages you created or contributed to:
# Pages I created (default)atlcli wiki my
# Pages I contributed to (edited)atlcli wiki my --contributed
# Filter by spaceatlcli wiki my --space TEAM
# Filter by labelatlcli wiki my --label api
# Limit resultsatlcli wiki my --limit 50The wiki my command generates CQL like:
type = page AND creator = currentUser() ORDER BY lastModified DESCCQL Search
Section titled “CQL Search”Use full CQL for advanced queries:
atlcli wiki search --cql "space = TEAM AND label = api AND lastModified > now('-7d')"Search Filters
Section titled “Search Filters”By Space
Section titled “By Space”atlcli wiki search "query" --space TEAMatlcli wiki search "query" --space TEAM,DOCS,APIBy Content Type
Section titled “By Content Type”atlcli wiki search "query" --type pageatlcli wiki search "query" --type blogpostatlcli wiki search "query" --type attachmentBy Label
Section titled “By Label”# Single labelatlcli wiki search --label api
# Multiple labels (AND)atlcli wiki search --label "api,v2"By Creator
Section titled “By Creator”atlcli wiki search --creator "alice@company.com"atlcli wiki search --creator currentUser()By Ancestor
Section titled “By Ancestor”Search within a page tree:
atlcli wiki search "query" --ancestor 12345By Date
Section titled “By Date”# Modified recentlyatlcli wiki search --modified-since "7d"atlcli wiki search --modified-since "2025-01-01"
# Created recentlyatlcli wiki search --created-since "30d"Search Options
Section titled “Search Options”| Flag | Description |
|---|---|
--space | Filter by space key(s) |
--type | Content type: page, blogpost, attachment |
--label | Filter by label(s) |
--title | Search in title only |
--creator | Filter by creator |
--ancestor | Search under page tree |
--modified-since | Modified after date/duration |
--created-since | Created after date/duration |
--limit | Max results (default: 25) |
--start | Pagination offset |
--format | Output format: table (default), compact |
--json | JSON output |
Output Formats
Section titled “Output Formats”Table (Default)
Section titled “Table (Default)”atlcli wiki search "API" --space TEAMID TITLE SPACE MODIFIED12345 API Reference TEAM 2025-01-1412346 API Authentication TEAM 2025-01-1312347 API Rate Limits TEAM 2025-01-10atlcli wiki search "API" --space TEAM --json{ "schemaVersion": "1", "results": [ { "id": "12345", "title": "API Reference", "space": {"key": "TEAM", "name": "Team Docs"}, "type": "page", "url": "https://company.atlassian.net/wiki/spaces/TEAM/pages/12345", "excerpt": "...comprehensive <em>API</em> documentation...", "lastModified": "2025-01-14T10:00:00Z", "creator": {"displayName": "Alice"}, "labels": ["api", "reference"] } ], "total": 42, "limit": 25, "start": 0}CQL Reference
Section titled “CQL Reference”Common Operators
Section titled “Common Operators”| Operator | Example |
|---|---|
= | space = TEAM |
!= | space != ARCHIVE |
~ | title ~ "API*" (contains) |
IN | space IN (TEAM, DOCS) |
NOT IN | label NOT IN (draft, deprecated) |
AND | space = TEAM AND type = page |
OR | label = api OR label = docs |
Date Functions
Section titled “Date Functions”| Function | Description |
|---|---|
now() | Current time |
now('-7d') | 7 days ago |
now('-1M') | 1 month ago |
startOfDay() | Start of today |
startOfWeek() | Start of current week |
Special Values
Section titled “Special Values”| Value | Description |
|---|---|
currentUser() | Logged-in user |
currentSpace() | Current space context |
Examples
Section titled “Examples”Find Outdated Content
Section titled “Find Outdated Content”atlcli wiki search --cql "lastModified < now('-90d') AND space = DOCS"Find My Recent Pages
Section titled “Find My Recent Pages”atlcli wiki search --creator currentUser() --modified-since 7dFind Pages Without Labels
Section titled “Find Pages Without Labels”atlcli wiki search --cql "space = TEAM AND label IS EMPTY"Find Draft Content
Section titled “Find Draft Content”atlcli wiki search --label draft --space TEAMFull-Text Search in Title
Section titled “Full-Text Search in Title”atlcli wiki search --title "installation guide"Export Search Results
Section titled “Export Search Results”# Get all IDs for scriptingatlcli wiki search --label api --json | jq -r '.results[].id'
# Export to CSVatlcli wiki search --space TEAM --json | \ jq -r '.results[] | [.id, .title, .lastModified] | @csv'Pagination
Section titled “Pagination”For large result sets:
# First 25atlcli wiki search "query" --limit 25 --start 0
# Next 25atlcli wiki search "query" --limit 25 --start 25
# Get all (iterate)START=0while true; do RESULT=$(atlcli wiki search "query" --limit 100 --start $START --json) COUNT=$(echo $RESULT | jq '.results | length') [ "$COUNT" -eq 0 ] && break echo $RESULT | jq -r '.results[].title' START=$((START + 100))doneTroubleshooting
Section titled “Troubleshooting”No Results Found
Section titled “No Results Found”Symptom: Search returns empty results for content you know exists.
Causes:
- Content hasn’t been indexed yet (newly created pages)
- Search query syntax error
- Space filter excludes the target space
Fix: Wait a few minutes for indexing, or check CQL syntax. Try without space filter to verify.
CQL Syntax Error
Section titled “CQL Syntax Error”Symptom: Error: CQL parse error
Cause: Invalid CQL query syntax.
Fix: Check operators and field names. Use quotes around values with spaces.
Related Topics
Section titled “Related Topics”
Jira and Confluence are trademarks of Atlassian Corporation Plc.
atlcli is not affiliated with, endorsed by, or sponsored by Atlassian.