{"id":17922502,"url":"https://github.com/gierens/wikijs-rs","last_synced_at":"2025-03-24T02:32:34.688Z","repository":{"id":195261335,"uuid":"692359816","full_name":"gierens/wikijs-rs","owner":"gierens","description":"API bindings, CLI client and FUSE filesystem for Wiki.js written in Rust.","archived":false,"fork":false,"pushed_at":"2025-02-20T09:42:52.000Z","size":1188,"stargazers_count":23,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T06:48:02.724Z","etag":null,"topics":["api","bindings","cli","crate","fuse","lib","rust","wiki-js","wikijs"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/wikijs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gierens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-16T08:37:14.000Z","updated_at":"2025-02-20T09:42:50.000Z","dependencies_parsed_at":"2023-11-30T22:27:15.449Z","dependency_job_id":"11a33b54-3137-42e8-9aa3-5f6b308bd935","html_url":"https://github.com/gierens/wikijs-rs","commit_stats":null,"previous_names":["gierens/wikijs-rs"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gierens%2Fwikijs-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gierens%2Fwikijs-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gierens%2Fwikijs-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gierens%2Fwikijs-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gierens","download_url":"https://codeload.github.com/gierens/wikijs-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245198727,"owners_count":20576426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bindings","cli","crate","fuse","lib","rust","wiki-js","wikijs"],"created_at":"2024-10-28T20:39:26.587Z","updated_at":"2025-03-24T02:32:34.361Z","avatar_url":"https://github.com/gierens.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# wikijs-rs\n\n![](https://raw.githubusercontent.com/gierens/wikijs-rs/main/logo/logo-small.png)\n\nAPI bindings, CLI client and FUSE filesystem for [Wiki.js](https://js.wiki/)\nwritten in Rust.\n\n[![Tests](https://github.com/gierens/wikijs-rs/actions/workflows/testing.yml/badge.svg)](https://github.com/gierens/wikijs-rs/actions/workflows/testing.yml)\n![Crates.io](https://img.shields.io/crates/v/wikijs?link=https://crates.io/crates/wikijs)\n![Crates.io](https://img.shields.io/crates/l/wikijs?link=https://crates.io/crates/wikijs)\n\n\u003c/div\u003e\n\n**What's inside?**\n- [Library](#library): Rust bindings to Wiki.js's entire GraphQL API as well\n  as asset up- and download via the REST API.\n  **Usable but not battle-tested**\n- [CLI](#cli): Command-line client for those bindings allowing things like\n  editing pages with your editor.\n  **Usable but not complete yet**\n- [Filesystem](#filesystem): A FUSE filesystem to mount your wiki and work on it locally.\n  **Not usable yet, heavily work-in-progress.**\n\n## Library\n\nThe library basically gives you a struct `Api` that you hand the url and\ncredentials for you Wiki.js instance to, and that exposes functions for all\nthe different GraphQL queries and mutations as well as asset down- and upload\nvia the REST API. For detailed information check the\n[documentation](https://docs.rs/wikijs), otherwise here a short example:\n\n### Usage\n\nAdd the following dependency to your `Cargo.toml`:\n```toml\n[dependencies]\nwikijs = \"0.2\"\n```\nCreate an instance of `Api` and use its functions:\n```rust\nuse wikijs::{Api, Credentials};\n\nlet api = Api::new(\n    \"http://localhost:3000\".to_string(),\n    Credentials::Key(\"my-api-key\".to_string()),\n).unwrap();\nprintln!(\"{:?}\", api.page_get(1).unwrap());\n\n```\n## CLI\n\nThis crate ships a command-line tool also called `wikijs` to directly interact\nwith your Wiki.js instance from the CLI. On top of exposing the library\nfunctions it also offers additional functionality like editing pages with\nyour favorite editor.\n\n### Build\n```bash\ncargo build --features=cli\n```\n\n### Install\nThe CLI is packaged via cargo, as well as Debian and AUR package, see\n[Installation](#installation) for details.\n\n### Usage\nThe tool takes the URL and credentials either from the arguments or\nenvironment variables. For the latter option use something like this:\n```bash\nexport WIKI_JS_BASE_URL=https://wiki.mydomain.com\nexport WIKI_JS_API_KEY=MY-SUPER-SECRET-API-KEY\n```\nor for password authentication use:\n```bash\nexport WIKI_JS_USERNAME=\"USERNAME or EMAIL\"\nexport WIKI_JS_PASSWORD=\"PASSWORD\"\n```\nNote, in case you're using something else then the default authentication\nprovider like LDAP, you have to set the variable `WIKI_JS_AUTH_PROVIDER` to\nits UUID.\n\nThen you can for example create a page named `test`, list pages and edit it\nwith:\n```bash\nwikijs page create test\nwikijs page list\nwikijs page edit \u003cID\u003e\n```\nwhere the `ID` is found in the `page list` output.\n\n## Filesystem\n\n**WARNING: Not really usable yet! Careful!**\n\n**Also in case you wanna PR on\nthis please coordinate via issues, as I'm currently heavily refactoring this\nto add a caching layer and include assets.**\n\nThis crate also ships FUSE filesystem called `wikifs` to mount your Wiki.js\ninstance locally and view and manipulate it with what ever programs you like.\n\n\n### Build\n```bash\ncargo build --features=fuse\n```\n\n### Install\n```bash\ncargo install wikijs --features=fuse\n```\n\n### Usage\nThe tool takes the URL and credentials either from the arguments or\nenvironment variables. For the latter option use something like this:\n```bash\nexport WIKI_JS_BASE_URL=https://wiki.mydomain.com\nexport WIKI_JS_API_KEY=MY-SUPER-SECRET-API-KEY\n```\nThen you can mount the filesystem like so:\n```bash\nmkdir /tmp/wikijs\nwikifs /tmp/wikijs\n```\nAnd in another terminal use it like this:\n```bash\ncd /tmp/wikijs\nls\ncat test.md\n```\nprovided you have a `markdown` page located at `/test` in your wiki.\n\n## Installation\nThese instructions are for the CLI only so far, as the FUSE filesystem is not\nready to be shipped.\n\n### Cargo\nRun the following to install the CLI from [crates.io](https://crates.io):\n```bash\ncargo install wikijs --features=cli\n```\n\n### Arch\nThe CLI is available on [AUR](https://aur.archlinux.org/packages/wikijs-rs).\n\n### Debian and Ubuntu\nThe CLI is available from [deb.gierens.de](http://deb.gierens.de). The GPG\npublic key is in this repo under [deb.asc](/deb.asc).\n\nFirst make sure you have the `gpg` command, and otherwise install it via:\n\n```bash\nsudo apt update\nsudo apt install -y gpg\n```\n\nThen install `wikijs-rs` via:\n\n```bash\nsudo mkdir -p /etc/apt/keyrings\nwget -qO- https://raw.githubusercontent.com/gierens/wikijs-rs/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg\necho \"deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main\" | sudo tee /etc/apt/sources.list.d/gierens.list\nsudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list\nsudo apt update\nsudo apt install -y wikijs-rs\n```\n\n## Contributing\nUse small commits that make isolated changes to a single module and name them\naccording to [conventional commits](https://www.conventionalcommits.org/).\n\nTwo parts where especially first-time contributions should be fairly easy and\nare also really needed is writing docstrings and integration tests. Apart from\nthat the CLI still needs to implement many of the library functions.\n\nPlease check issues and PRs first and maybe make an issue or draft PR of your\nown so we can coordinate work. This is especially important for the FUSE\nfilesystem, as I'm currently heavily refactoring that.\n\n## Testing\nSince this depends on Wiki.js the integration tests located in [tests/](tests)\ncan also not be done without it. Therefore the\n[docker-compose.yml](docker-compose.yml) is used to run a local instance of it\non port 80. This setup is also used in the CI workflows. Note that many tests\nassume the wiki to be fresh, no pages no anything ... that's why there is also\nno Docker volume, so that on every rebuild all previous data is lost. This also\nmeans you should make sure you removed everything yourself from the instance\nduring debugging when testing.\n\nThe tests furthermore assume the wiki to have the following admin credentials:\n- email: `admin@admin.com`\n- password: `password`\n\nTo set this up automatically on initial startup of the wiki, you may use\n[scripts/finalize_wiki_setup.sh](scripts/finalize_wiki_setup.sh) which also\nassumes the wiki to run on `http://localhost:80`.\n\n## License\nThis projects is licensed under [AGPL-3.0](/LICENSE) since\n[Wiki.js](https://github.com/requarks/wiki) is, too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgierens%2Fwikijs-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgierens%2Fwikijs-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgierens%2Fwikijs-rs/lists"}