Skip to content
Merged
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
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on a Real Geeks website; the second is for agents changing this repository.
`geekcli` is the Real Geeks command line. Today it manages a site's website
content: blog posts and categories, content, area, agent, market report and
home valuation pages, the home page, navigation, sidebars, footers, banners, settings,
design and uploaded files.
search forms, design and uploaded files.

Install:

Expand Down Expand Up @@ -54,7 +54,7 @@ The rules that keep a live site safe:
write again. `--fail-on-warnings` turns them into exit 5.
6. Note `revisions <ref> --limit 1` before a large rewrite of a page, area
page, market report, valuation page, post, footer, sidebar or navigation bar (and
`settings revisions` / `design revisions` before those), so a bad result
`settings revisions` / `design revisions` / `search-forms revisions` before those), so a bad result
is one `revert` away. A deleted or overwritten file comes back with
`files restore` for 90 days.
7. Check search criteria with `search check --count --strict` before putting
Expand Down Expand Up @@ -101,6 +101,7 @@ src/
├── sidebars.rs # sidebars and html/links items
├── footers.rs # shared footer HTML blocks
├── settings.rs # typed site settings; coerce() maps NAME=value text to JSON
├── search_forms.rs # the search forms document (advanced tabs, home page search): get/fields/update --data/reset, revisions
├── design.rs # template + colour scheme; preview link rendered via snapshot::render
├── banners.rs # banners; pages attach one with --banner (pages::AttachArgs)
├── featured.rs # Featured Pages tile groups (anna-modern home page)
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

The Real Geeks command line. `geekcli` manages a Real Geeks website: blog
posts and categories, content, area, agent, market report and home valuation
pages, the home page, navigation, sidebars, footers, banners, settings, design and uploaded
files. It is
pages, the home page, navigation, sidebars, footers, banners, settings, search
forms, design and uploaded files. It is
built to be driven by scripts and AI agents as much as by people: JSON on
stdout when piped, JSON errors on stderr, stable exit codes, and a built-in
guide written for agents.
Expand All @@ -36,8 +36,8 @@ A Real Geeks website can be run by the AI tools you already use:

- **The whole site is an open, documented API.** Blog posts, pages,
neighborhood (area) pages, market report and home valuation pages, the home
page, navigation,
sidebars, footers, banners, settings, design and files, all described in the
page, navigation, sidebars, footers, banners, settings, search forms, design
and files, all described in the
[Content API documentation](https://developers.realgeeks.com/content-api/).
- **Two ways in.** Connect Claude or ChatGPT to the site and ask in plain
English, or let a coding agent such as Claude Code or Codex drive geekcli.
Expand Down
51 changes: 51 additions & 0 deletions docs/GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ subcommands: `revisions` (list), `revision` (preview) and `revert` (undo).
| banners | `banners` | every field |
| site settings | `settings` | the settings that save changed |
| design | `design` | `template` and `styles` (the colour scheme and its variables) |
| search forms | `search-forms` | the whole set of search forms (§31) |

For content this is the same history as the admin's Versions page, so
changes made in the admin appear here and can be reverted here, and the
Expand Down Expand Up @@ -1614,3 +1615,53 @@ geekcli valuation-pages delete /riverside-home-value/
--mobile`): a long headline pushes the address box down on a phone.

API reference: [Home valuation pages](https://developers.realgeeks.com/content-api/site-pages/#home-valuation-pages).

## 31. Search forms

The site's search forms are the advanced search tabs (Advanced Search,
Condo Search, Sold Search…, as `pages`) and the home page search
(`home_page_forms`): which fields each shows, in what order, with what
labels. The site owner edits the same thing at Search Forms in the site
backend. The whole document is read, edited and sent back.

```bash
geekcli search-forms get > forms.json # pages, fields, rules
geekcli search-forms fields -s school # what the MLS offers
geekcli search-forms update --data @forms.json --dry-run
geekcli search-forms update --data @forms.json
geekcli search-forms revisions --limit 1
geekcli search-forms reset # back to the board's forms
```

- `pages` is the full list of tabs in order: leave a page out to remove
it, leave out `id` to create one. `home_page_forms` can be changed but
not added to or removed. Omit either key to keep it.
- Each page has `primary` (location, or the search box) and `secondary`
(property details). An item is `{"field": "city", "label": "Town",
"widget": "multiselect"}`; a min/max field is one item,
`{"field": "beds", "range": "min", "label_min": "Bedrooms"}`.
- Each page's `rules` say what its layout shows, and anything else is
refused (exit 5): advanced pages take only drop-downs and lists
(`select`, `multiselect`) in `primary`; home page forms show only
price, beds, baths and property types in `secondary`; the theme writes
some labels itself (Price, Sold Within).
- `"fixed": true` items are built-in filters (Condo Search's type = condo,
Sold Search's "Sold only"). They can't be removed; remove the page.
- MLS Number Search and Address Search are ready-made
(`"prepackaged": true`): nothing on them changes. Add one back with just
`{"id": "mls_search"}`; `prepackaged_pages` lists what the site can add,
including the board's filter pages.
- A field whose choices come from the MLS is refused when it would load
more than 3,000 of them (street names, for example); `fields` shows each
one's `choices`. Always `--dry-run` first: it runs this check too.
- Warnings, not errors: `long_form` (more than 14 drop-downs on a page:
suggest trimming) and `area_directory_changes` (Advanced Search starts
with a different field, which reorganizes the area pages' Browse All
directory).
- The first save copies the board's forms onto the site, after which
board changes no longer reach it. `reset` undoes that; `revert` undoes
one change and everything after it.
- Snapshot a search page after a change (`geekcli snapshot
/search/advanced_search/`).

API reference: [Search forms](https://developers.realgeeks.com/content-api/design-settings-files/#search-forms).
8 changes: 6 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use clap_complete::Shell;
use crate::client::Client;
use crate::commands::{
agent_pages, api, area_pages, auth, banners, blog_home, categories, design, featured, files,
footers, guide, home_page, inspect, market_reports, nav, pages, posts, search, settings,
sidebars, snapshot, templates, update, valuation_pages, Context,
footers, guide, home_page, inspect, market_reports, nav, pages, posts, search, search_forms,
settings, sidebars, snapshot, templates, update, valuation_pages, Context,
};
use crate::config::{self, Config, Overrides};
use crate::error::{Error, Result};
Expand Down Expand Up @@ -154,6 +154,9 @@ pub enum Command {
Featured(featured::FeaturedCommand),
/// Site settings
Settings(settings::SettingsCommand),
/// The site's search forms: advanced search tabs and the home page search
#[command(name = "search-forms")]
SearchForms(search_forms::SearchFormsCommand),
/// Template and colour scheme, with unsaved previews
Design(design::DesignCommand),
/// Uploaded files (images, PDFs) on the site's media bucket
Expand Down Expand Up @@ -243,6 +246,7 @@ fn dispatch(cli: Cli, printer: Printer) -> Result<()> {
Command::Banners(cmd) => banners::run(&ctx, cmd),
Command::Featured(cmd) => featured::run(&ctx, cmd),
Command::Settings(cmd) => settings::run(&ctx, cmd),
Command::SearchForms(cmd) => search_forms::run(&ctx, cmd),
Command::Design(cmd) => design::run(&ctx, cmd),
Command::Files(cmd) => files::run(&ctx, cmd),
Command::Snapshot(args) => snapshot::run(&ctx, &args),
Expand Down
3 changes: 3 additions & 0 deletions src/commands/guide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ pub fn find(all: &[Section<'_>], topic: &str) -> Vec<usize> {
("revert", "revisions and undo"),
("history", "revisions and undo"),
("restore", "files"),
("search-forms", "search forms"),
("forms", "search forms"),
("tabs", "search forms"),
];
let needle = aliases
.iter()
Expand Down
1 change: 1 addition & 0 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub mod posts;
pub mod provenance;
pub mod revisions;
pub mod search;
pub mod search_forms;
pub mod settings;
pub mod sidebars;
pub mod snapshot;
Expand Down
Loading
Loading