@yuiseki/gyazocli 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/sync.js +25 -4
- package/dist/index.js +1 -1
- package/docs/ADR/003-cli-structure.md +3 -1
- package/package.json +1 -1
- package/skills/gyazo/SKILL.md +8 -0
package/dist/commands/sync.js
CHANGED
|
@@ -13,12 +13,24 @@ function registerSyncCommand(program) {
|
|
|
13
13
|
.option('--days <number>', 'number of days to sync (used when --date is omitted)')
|
|
14
14
|
.option('--date <yyyy|yyyy-mm|yyyy-mm-dd>', 'sync only this date/month/year range')
|
|
15
15
|
.option('--max-pages <number>', 'max pages to fetch', '10')
|
|
16
|
+
.option('--query <query>', 'fill the cache from a search instead of the listing')
|
|
16
17
|
.action(async (options) => {
|
|
17
18
|
await (0, credentials_1.ensureAccessToken)();
|
|
18
19
|
if (options.date && options.days) {
|
|
19
20
|
console.error('Error: --date and --days cannot be used together.');
|
|
20
21
|
process.exit(1);
|
|
21
22
|
}
|
|
23
|
+
if (options.query && (options.date || options.days)) {
|
|
24
|
+
// Search results are not ordered the same way for every query: a plain
|
|
25
|
+
// query comes back newest first, while a `date:` one starts at the
|
|
26
|
+
// beginning of its range. Nothing here can bound a walk by date
|
|
27
|
+
// safely, and the query language can: put the range in the query.
|
|
28
|
+
console.error('Error: --query cannot be used with --date or --days.');
|
|
29
|
+
console.error('Hint: bound the range inside the query, as');
|
|
30
|
+
console.error(' --query "has:exif date:2026-08"');
|
|
31
|
+
console.error(' --query "has:exif since:2026-08-01 until:2026-08-31"');
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
22
34
|
const maxPages = (0, options_1.parsePositiveIntegerOption)(options.maxPages, '--max-pages');
|
|
23
35
|
let startDate;
|
|
24
36
|
let endDate;
|
|
@@ -37,20 +49,29 @@ function registerSyncCommand(program) {
|
|
|
37
49
|
startDate.setDate(startDate.getDate() - days - 1);
|
|
38
50
|
startDate.setHours(0, 0, 0, 0);
|
|
39
51
|
}
|
|
40
|
-
|
|
52
|
+
if (options.query) {
|
|
53
|
+
console.log(`Syncing images matching ${JSON.stringify(options.query)}...`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.log(`Syncing images between ${startDate.toISOString()} and ${endDate.toISOString()}...`);
|
|
57
|
+
}
|
|
41
58
|
const hourlyIndices = new Map();
|
|
42
59
|
for (let page = 1; page <= maxPages; page++) {
|
|
43
|
-
const images =
|
|
60
|
+
const images = options.query
|
|
61
|
+
? await (0, api_1.searchImages)(options.query, page, 100)
|
|
62
|
+
: await (0, api_1.listImages)(page, 100);
|
|
44
63
|
if (images.length === 0)
|
|
45
64
|
break;
|
|
46
65
|
let reachedLimit = false;
|
|
47
66
|
for (const img of images) {
|
|
48
67
|
const createdAt = new Date(img.created_at);
|
|
49
|
-
|
|
68
|
+
// A query says for itself what it covers, and the results are not
|
|
69
|
+
// ordered predictably enough to stop early on a date.
|
|
70
|
+
if (!options.query && createdAt > endDate) {
|
|
50
71
|
// Skip images newer than target range.
|
|
51
72
|
continue;
|
|
52
73
|
}
|
|
53
|
-
if (createdAt < startDate) {
|
|
74
|
+
if (!options.query && createdAt < startDate) {
|
|
54
75
|
reachedLimit = true;
|
|
55
76
|
break;
|
|
56
77
|
}
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ program
|
|
|
26
26
|
.name('gyazo')
|
|
27
27
|
.description('Gyazo Memory CLI for AI Secretary')
|
|
28
28
|
.option('--mcp-server', 'run as a Model Context Protocol server over stdio')
|
|
29
|
-
.version('0.
|
|
29
|
+
.version('0.8.0');
|
|
30
30
|
(0, config_1.registerConfigCommand)(program);
|
|
31
31
|
(0, list_1.registerListCommand)(program);
|
|
32
32
|
(0, get_1.registerGetCommand)(program);
|
|
@@ -13,7 +13,7 @@ Adopt and document the existing top-level command structure.
|
|
|
13
13
|
|
|
14
14
|
### 1. Program Metadata
|
|
15
15
|
- Binary name: `gyazo`
|
|
16
|
-
- Version: `0.
|
|
16
|
+
- Version: `0.8.0`
|
|
17
17
|
- Description: `Gyazo Memory CLI for AI Secretary`
|
|
18
18
|
|
|
19
19
|
### 2. Commands
|
|
@@ -118,6 +118,8 @@ Adopt and document the existing top-level command structure.
|
|
|
118
118
|
- `--days <number>` (default: `1`, used when `--date` is omitted)
|
|
119
119
|
- `--date <yyyy|yyyy-mm|yyyy-mm-dd>`
|
|
120
120
|
- `--max-pages <number>` (default: `10`)
|
|
121
|
+
- `--query <query>` (fill from a search instead of the listing; not with
|
|
122
|
+
`--date` or `--days`, because the range belongs inside the query)
|
|
121
123
|
- `gyazo import <type> <dir>`
|
|
122
124
|
- Supported types: `json`, `hourly`
|
|
123
125
|
|
package/package.json
CHANGED
package/skills/gyazo/SKILL.md
CHANGED
|
@@ -97,12 +97,20 @@ endpoint returns the first 100 and cannot page.
|
|
|
97
97
|
```bash
|
|
98
98
|
gyazo sync --days 7 # yesterday back through 7 days
|
|
99
99
|
gyazo sync --date 2026-08 # a whole month
|
|
100
|
+
gyazo sync --query "has:exif OR has:location" --max-pages 20
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
`sync` covers yesterday backwards and never today, because today is still
|
|
103
104
|
happening. For anything from today use `ls --today`, `search`, or a ranking
|
|
104
105
|
command with `--today`.
|
|
105
106
|
|
|
107
|
+
`--query` fills the cache from a search instead of the listing, which is how to
|
|
108
|
+
gather one kind of capture without walking past everything else: photographs
|
|
109
|
+
are a small fraction of a day's screenshots. Put any date range inside the
|
|
110
|
+
query (`date:2026-08`, `since:... until:...`) rather than in `--date`, which
|
|
111
|
+
`--query` refuses. Budget about 40 seconds per page of 100 captures that are
|
|
112
|
+
not cached yet.
|
|
113
|
+
|
|
106
114
|
## Answering questions with captures
|
|
107
115
|
|
|
108
116
|
- A day is a local day. `--date 2026-08-30` means that date in this machine's
|