dimcli
- Repo stars 49
- License MIT
- Author updated Live
- Author repo dimcli
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @digital-science · MIT
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- External requests
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: dimcli
description: Query the Dimensions Analytics API using the dimcli CLI tool. Use when the user wants to search…
category: other
runtime: Python
---
# dimcli output preview
## PART A: Task fit
- Use case: Query the Dimensions Analytics API using the dimcli CLI tool. Use when the user wants to search or retrieve data from Dimensions — publications, grants, patents, clinical trials, datasets, researchers, organisations, policy documents, or reports. Triggers on requests like "search Dimensions for...", "find publications about...", "look up grants on...", "query the Dimensions API", or "/dimcli"..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Workflow / Query Structure / Output Format” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Query the Dimensions Analytics API using the dimcli CLI tool. Use when the user wants to search or retrieve data from Dimensions — publications, grants, patents, clinical trials, datasets, researchers, organisations, policy documents, or reports. Triggers on requests like "search Dimensions for...", "find publications about...", "look up grants on...", "query the Dimensions API", or "/dimcli".”.
- **02** When the source has headings, the agent prioritizes “Workflow / Query Structure / Output Format” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; may access external network resources; usually needs no extra API key.
## Running Rules
- read files, write/modify files; may access external network resources; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Workflow / Query Structure / Output Format”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: dimcli
description: Query the Dimensions Analytics API using the dimcli CLI tool. Use when the user wants to search…
category: other
source: digital-science/dimcli
---
# dimcli
## When to use
- Query the Dimensions Analytics API using the dimcli CLI tool. Use when the user wants to search or retrieve data from…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Workflow / Query Structure / Output Format” and keep inference separate from source facts.
- read files, write/modify files; may access external network resources; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "dimcli" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Workflow / Query Structure / Output Format
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files | may access external network resources
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Dimcli Skill
Query the Dimensions Analytics API via dimcli -q "..." and present results with clickable Dimensions URLs.
Workflow
- Identify the source and intent from the user's request
- Construct a valid DSL query — always include
idso URLs can be built - Run:
dimcli -q "<query>" -f json - Parse JSON and present a numbered list with title, key metadata, and Dimensions URL
- Offer follow-ups: refine, export to CSV, fetch more records
If unsure about available fields, run dimcli -q "describe schema" first.
DSL grammar and URL patterns: See grammar.md and urls.md.
Query Structure
search <source> [for "<keywords>"] [where <filters>] return <source>[field1+field2+...] [limit N] [sort by <field>]
Always include id in return fields. Use [basics] for a standard field set.
Output Format
Present results as a numbered list:
1. **Title of the work** (2023)
Journal: Nature | Cited by: 142
https://app.dimensions.ai/details/publication/pub.1234567890
2. ...
Summarise after the list: total found, date range, notable patterns.
Flags
| Flag | Use case |
|---|---|
-f json |
Default — structured data |
-f csv --nice |
Clean tabular export |
-f df |
Formatted terminal table |
-f df --html |
HTML table with hyperlinks |
Advanced
- Large results: API returns max 1000/call (50k with pagination). Suggest narrowing filters or using
query_iterative()in Python. - Schema lookup:
dimcli -q "describe schema" - Export:
dimcli -q "..." -f csv --nice > results.csv
Subcommand: profile <grid_id>
Generate a full profile report for an organisation, given its GRID ID (format: grid.XX).
Workflow
Run all queries sequentially (never in parallel — concurrent calls cause session conflicts).
Step 1 — Fetch organisation metadata:
dimcli -q "search organizations where id = \"<grid_id>\" return organizations[acronym+city_name+country_code+country_name+dimensions_url+established+external_ids_fundref+hierarchy_details+id+isni_ids+latitude+linkout+longitude+name+organization_child_ids+organization_parent_ids+organization_related_ids+ror_ids+status+types+ultimate_parent_id+wikidata_ids+wikipedia_url]" -f json 2>/dev/null
Note:
organizations[all]is not valid — always enumerate fields explicitly.
Step 2 — Count documents per source:
Run each query below sequentially. Extract _stats.total_count from the JSON.
# Publications
dimcli -q "search publications where research_orgs = \"<grid_id>\" return publications limit 1" -f json 2>/dev/null
# Grants
dimcli -q "search grants where research_orgs = \"<grid_id>\" return grants limit 1" -f json 2>/dev/null
# Datasets
dimcli -q "search datasets where research_orgs = \"<grid_id>\" return datasets limit 1" -f json 2>/dev/null
# Clinical Trials
dimcli -q "search clinical_trials where research_orgs = \"<grid_id>\" return clinical_trials limit 1" -f json 2>/dev/null
# Patents — NOTE: uses 'assignees', not 'research_orgs'
dimcli -q "search patents where assignees = \"<grid_id>\" return patents limit 1" -f json 2>/dev/null
# Reports
dimcli -q "search reprots where research_orgs = \"<grid_id>\" return reports limit 1" -f json 2>/dev/null
# Policy Documents — NOTE: uses 'publisher_org', not 'research_orgs'
dimcli -q "search policy_documents where publisher_org = \"<grid_id>\" return policy_documents limit 1" -f json 2>/dev/null
Each source uses a different field name to filter by organisation:
Source Filter field publications, grants, datasets, clinical_trials research_orgspatents assigneespolicy_documents publisher_org
Step 2b — Count documents where org is a funder:
# Publications (as funder)
dimcli -q "search publications where funders = \"<grid_id>\" return publications limit 1" -f json 2>/dev/null
# Grants (as funder) — NOTE: uses 'funder_orgs', not 'funders'
dimcli -q "search grants where funder_orgs = \"<grid_id>\" return grants limit 1" -f json 2>/dev/null
# Datasets (as funder)
dimcli -q "search datasets where funders = \"<grid_id>\" return datasets limit 1" -f json 2>/dev/null
# Clinical Trials (as funder)
dimcli -q "search clinical_trials where funders = \"<grid_id>\" return clinical_trials limit 1" -f json 2>/dev/null
# Patents (as funder)
dimcli -q "search patents where funders = \"<grid_id>\" return patents limit 1" -f json 2>/dev/null
# Reports (as funder) — NOTE: uses 'funder_orgs', not 'funders'
dimcli -q "search reports where funder_orgs = \"<grid_id>\" return reports limit 1" -f json 2>/dev/null
Step 3 — Piping to Python:
Always redirect stderr with 2>/dev/null before piping to Python. The CLI prints
"Reusing cached session." to stdout, which breaks JSON parsing if included.
dimcli -q "..." -f json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['_stats']['total_count'])"
Output Format
Print the profile as a markdown report:
# Organisation Profile: <Name> (<acronym>)
**GRID ID:** `<id>` | **Status:** <status> | **Type:** <types> | **Established:** <year>
## Location
- City: <city>, <country>
- Coordinates: <lat>, <lon>
## Links
- Website: <linkout>
- Wikipedia: <wikipedia_url>
- Dimensions: <dimensions_url>
## External Identifiers
- ROR: <ror_ids>
- ISNI: <isni_ids>
- Wikidata: <wikidata_ids>
- FundRef IDs: <external_ids_fundref>
## Hierarchy
- Ultimate parent: <ultimate_parent_id>
- Parent orgs: <organization_parent_ids>
- Child orgs: <organization_child_ids>
- Related orgs: <organization_related_ids>
## Document Counts (as Research Org)
| Source | Count | Dimensions URL |
|--------|------:|----------------|
| Publications | N | https://app.dimensions.ai/discover/publication?and_facet_research_org=<grid_id> |
| Grants | N | https://app.dimensions.ai/discover/grant?search_mode=content&or_facet_research_org=<grid_id> |
| Datasets | N | https://app.dimensions.ai/discover/dataset?and_facet_research_org=<grid_id> |
| Clinical Trials | N | https://app.dimensions.ai/discover/clinical_trial?and_facet_research_org=<grid_id> |
| Patents | N | https://app.dimensions.ai/discover/patent?and_facet_research_org=<grid_id> |
| Reports | N | https://app.dimensions.ai/discover/technical_report?and_facet_research_org=<grid_id> |
| Policy Documents | N | https://app.dimensions.ai/discover/policy_document?and_facet_research_org=<grid_id> |
| **Total** | **N** | |
## Document Counts (as Funder)
| Source | Count | Dimensions URL |
|--------|------:|----------------|
| Publications | N | https://app.dimensions.ai/discover/publication?or_facet_funder=<grid_id> |
| Grants | N | https://app.dimensions.ai/discover/grant?or_facet_funder=<grid_id> |
| Datasets | N | https://app.dimensions.ai/discover/data_set?or_facet_funder=<grid_id> |
| Clinical Trials | N | https://app.dimensions.ai/discover/clinical_trial?or_facet_funder=<grid_id> |
| Patents | N | https://app.dimensions.ai/discover/patent?or_facet_funder=<grid_id> |
| Reports | N | https://app.dimensions.ai/discover/technical_report?or_facet_funder=<grid_id> |
| **Total** | **N** | |
Export
If the user asks to export, save the report to <grid_id>_profile.md using the Write tool.
Confirm the file path after saving.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review