flycal-cli 0.7.3 → 0.7.7

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.
data/lib/flycal_cli.rb CHANGED
@@ -7,9 +7,12 @@ require "flycal_cli/auth"
7
7
  require "flycal_cli/duration_parser"
8
8
  require "flycal_cli/date_time_parser"
9
9
  require "flycal_cli/clipboard"
10
+ require "flycal_cli/description_query"
10
11
  require "flycal_cli/calendar_service"
11
12
  require "flycal_cli/slot_finder"
12
13
  require "flycal_cli/slot_formatter"
14
+ require "flycal_cli/mock"
15
+ require "flycal_cli/pipeline"
13
16
  require "flycal_cli/cli"
14
17
 
15
18
  module FlycalCli
data/mcp/README.md CHANGED
@@ -1,29 +1,68 @@
1
1
  # flycal MCP catalog
2
2
 
3
- This directory contains a machine-readable description of **flycal-cli** commands for MCP (Model Context Protocol) servers.
3
+ Machine-readable description of **flycal-cli** for MCP servers.
4
4
 
5
5
  ## File
6
6
 
7
- - [`tools.json`](./tools.json) — tools catalog with MCP-style `inputSchema`, CLI argv templates, auth/interactivity flags, and config keys.
7
+ - [`tools.json`](./tools.json) — full catalog:
8
+ - `global_options` / `shared_formats` — shared `--locale`, date and duration formats
9
+ - `config.keys` — `~/.flycal/config.yml` keys used by the CLI
10
+ - `tools[].parameters` — human-readable parameter docs (cli flags, defaults, examples)
11
+ - `tools[].inputSchema` — JSON Schema for MCP tool registration
12
+ - `command.option_map` — how to build argv from tool arguments
8
13
 
9
14
  ## How an MCP server can use it
10
15
 
11
16
  1. Load `tools.json` at startup.
12
- 2. Register each entry in `tools` with your MCP SDK (`server.tool(...)`), using `name`, `description`, and `inputSchema`.
13
- 3. On tool call, build the argv:
17
+ 2. Register each entry in `tools` with your MCP SDK using `name`, `description`, and `inputSchema`.
18
+ 3. On tool call, build argv:
14
19
  - static tools → `command.argv`
15
- - parameterized tools → start from `command.argv_template`, then append pairs from `command.option_map` for each provided argument
20
+ - parameterized tools → start from `command.argv_template`, then for each provided arg append `command.option_map[arg]`
16
21
  - if `locale` is set → append `--locale <value>`
17
- 4. Run `flycal` as a subprocess and return stdout as text content.
18
- 5. Skip or gate tools with `"interactive": true` (`flycal_login`, `flycal_config`) unless a TTY is available.
22
+ 4. Run `flycal` as a subprocess and return stdout as text.
23
+ 5. Skip tools with `"interactive": true` (`flycal_login`, `flycal_config`) unless a TTY is available.
24
+
25
+ ## Parameters cheat sheet
26
+
27
+ ### Global
28
+
29
+ | Param | CLI | Values |
30
+ |---|---|---|
31
+ | `locale` | `--locale` | `en`, `it` |
32
+
33
+ ### `flycal_search`
34
+
35
+ | Param | CLI | Default | Notes |
36
+ |---|---|---|---|
37
+ | `calendar` | `--calendar` / `-c` | `calendar_default` | name or ID |
38
+ | `from` | `--from` / `-f` | today midnight | absolute or relative date |
39
+ | `to` | `--to` / `-t` | +30 days 23:59 | ignored if `in` set |
40
+ | `in` | `--in` / `-i` | — | duration from `from`, overrides `to` |
41
+ | `description` | `--description` / `-d` | — | contains filter |
42
+ | `locale` | `--locale` | config/`en` | |
43
+
44
+ ### `flycal_slots`
45
+
46
+ | Param | CLI | Default | Notes |
47
+ |---|---|---|---|
48
+ | `duration` | `--duration` | `45min` (config) | min free-range length |
49
+ | `from` | `--from` / `-f` | `now` (config) | absolute or relative (`monday`, `next monday`, …) |
50
+ | `in` | `--in` / `-i` | `1 week` | window from `--from` |
51
+ | `template` | `--template` / `-T` | first template (`work`) | from `slots.templates` |
52
+ | `calendar` | `--calendar` / `-c` | — | fallback if `exclude_calendars` empty |
53
+ | `locale` | `--locale` | config/`en` | |
54
+
55
+ ### Relative `--from` examples
56
+
57
+ `now`, `today`/`oggi`, `tomorrow`/`domani`, `monday`/`lunedi`, `next monday`/`prossimo lunedi`, `last friday`/`scorso venerdi`
19
58
 
20
59
  ## Suggested tools to expose
21
60
 
22
61
  | MCP tool | CLI | Notes |
23
62
  |---|---|---|
24
63
  | `flycal_search` | `flycal search ...` | Primary read tool |
25
- | `flycal_slots` | `flycal slots --in ... --duration ...` | Free slots |
64
+ | `flycal_slots` | `flycal slots ...` | Free slots |
26
65
  | `flycal_calendars` | `flycal calendars` | List name + id |
27
66
  | `flycal_version` | `flycal version` | Health / version check |
28
67
 
29
- Interactive / side-effect tools (`login`, `logout`, `config`, `update`) are documented in the catalog but are usually better left to the user terminal.
68
+ Interactive / side-effect tools (`login`, `logout`, `config`, `update`) are documented but usually better left to a user terminal.