Title: Page 8 – Alex Kirk

---

 * 
   ## 󠀁[Help Make (the) Friends (Plugin) Pretty](https://alex.kirk.at/2024/11/22/help-make-the-friends-plugin-pretty/)󠁿
   
 * November 22, 2024
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2024/11/current-friends-ui.
   png)
 * While I keep maintaining my [Friends plugin](https://github.com/akirk/friends)
   for WordPress, there is an area where it could do better because I am not great
   at it: the visual appeal.
 * From pretty early on, I designed the plugin in a way that it
    1. can be mainly used on the frontend (i.e. not in wp-admin),
    2. is based on [granular template files](https://github.com/akirk/friends/tree/main/templates/),
    3. and [each template file can be overriden](https://github.com/akirk/friends/wiki/Overriding-the-template-files).
 * Over time, some of this has changed or improved. For example, you can now see
   [your friends’ posts in widgets on your wp-admin dashboard](https://github.com/akirk/friends/pull/346),
   or, I’m making progress on [providing a block theme for Friends](https://github.com/akirk/friends/pull/362)
   so that it can be customized with the site editor.
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2024/11/current-friends-ui-
   1024x517.png)
 * This is the current Friends default theme, based on the [spectre.css framework](https://picturepan2.github.io/spectre/index.html)
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2024/11/friends-current-user-
   view-1024x543.png)
 * This is a user view with full posts in the current design
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2024/11/friends-widgets-1024x450.
   png)
 * Dashboard filled with Friends’ posts, [Netvibes style](https://www.netvibes.com/)
 * But, even as I wrote in the [Friends Wiki](https://github.com/akirk/friends/wiki)
   on how new themes can be created, I think this has remained unknown to users.
 * So, a year ago, as a demo, I created the [Mastodon-Like Interface plugin](https://github.com/akirk/friends-mastodon-like-interface).
   This is what the Friends plugin can also look like:
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2024/11/mastodon-like-interface-
   1024x733.png)
 * Unfortunately, this remained under people’s radar. So in the latest version of
   the Friends plugin, I have now made it more obvious [that the theme can be changed](https://github.com/akirk/friends/pull/393),
   by slightly adjusting how themes are loaded, giving the user more control over
   which theme is loaded:
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2024/11/friends-theme-selector.
   png)
 * In the course of this, I have updated the Friends Wiki with a more specific guide
   on [how to write themes for the Friends plugin](https://github.com/akirk/friends/wiki/Writing-Themes).
 * There have been some case studies about what a network between WordPresses could
   look like. For example, [Mike McAlister](https://mikemcalister.com/) has designed
   [some screens](https://dribbble.com/shots/20028090-OpenPress-A-Decentralized-WordPress-Community)
   for [what he called OpenPress at the time](https://olliewp.com/finding-a-new-home-for-the-wordpress-community/).
   And the mockups look great:
 * [[
 * [Finding a new home for the WordPress community](https://olliewp.com/finding-a-new-home-for-the-wordpress-community/)
 * I would love it if the community could help with creating some more themes to
   give people a choice. Recently, [Livia Gouvêa](https://github.com/liviacarolgouvea)
   has contributed [some layout improvements for the current sidebar](https://github.com/akirk/friends/pull/384).
   This is a great start, thank you, Livia! If you have a new theme, you can add
   them with [a pull request to the THEMES.md file](https://github.com/akirk/friends/blob/main/THEMES.md).
   As soon as there are some themes, we’ll make it easier to install them.
 * It is quite likely that people were detracted from getting started with the [Friends plugin](https://wordpress.org/plugins/friends/)
   because they don’t like the current theme (hat tip [Robert Windisch and his talk at WordCamp Karlsruhe](https://wordpress.tv/2024/10/12/wordpress-als-soziales-netzwerk-eine-vision-um-publishing-zu-demokratisieren/))
   but this would be too bad, because I believe it is an empowering tool, allowing
   you to become less dependent on third-party vendors, even if you’re “just” using
   it to [make your own WordPress your full featured, personal Mastodon instance](https://alex.kirk.at/2024/06/13/your-wordpress-as-your-personal-mastodon-instance/).
 * Looking forward to more Friends themes, this would be an awesome addition!
 * 
   ###### Fediverse Reactions
   
    -  [ ⌊Mad Mole⌉ ](https://mast.madmolelabs.com/@madmole)
 *  -  [ ⌊Tomi the Slav and 1024 others⌉ ](https://mastodon.social/@po3mah)
 * [Web](https://alex.kirk.at/category/web/)
 * 
   ## 󠀁[Setting Up a Local Ollama Copilot via LSP](https://alex.kirk.at/2024/11/15/setting-up-a-local-ollama-copilot-via-lsp/)󠁿
   
 * November 15, 2024
 * I am quite interested in running AI offline. Thus I really like [Ollama](https://github.com/ollama/ollama),
   and have [added automatic failover from ChatGPT to a local AI to my little terminal llm tool cll](https://alex.kirk.at/2023/10/20/chat-cli-renamed-and-added-ollama-support/)(
   get it on [Github at akirk/cll](https://github.com/akirk/cll)).
 * As a developer, an important local gap for me was [Github Copilot](https://github.com/features/copilot).
   Its function of autocomplete on steroids is really powerful in my day to day 
   work and speeds up my development a lot.
 * Now, how can you get this offline? Mostly, search engines point to [solutions that involve Visual Studio Code extensions](https://rahultah.medium.com/build-your-own-github-copilot-with-ollama-continue-llm-magic-and-api-power-745dd9597322),
   for example [Continue](https://www.continue.dev/) and lots of other dependencies.
 * 
   ### LSPs are independent of IDEs
   
 * But why should this involve IDE extensions? With the concept of LSPs (read [LSP: the good, the bad, and the ugly](https://www.michaelpj.com/blog/2024/09/03/lsp-good-bad-ugly.html)
   to learn how LSPs work), and the existence of [LSP-Copilot](https://github.com/TerminalFi/LSP-copilot),
   this should be independent of IDEs. And I personally use [Sublime Text](https://www.sublimetext.com/).
 * And indeed, it does work just on that basis: using the go proxy [ollama-copilot](https://github.com/bernardo-bruning/ollama-copilot)
   by [Bernardo de Oliveira Bruning](https://github.com/bernardo-bruning).
 * But for me it didn’t work out of the box. Thus, I’d like to share the steps that
   got this working for me. I use macOS.
 * 
   ### Steps to get it running
   
 * First, follow the [install instructions for Ollama and ollama-copilot](https://github.com/bernardo-bruning/ollama-copilot?tab=readme-ov-file#installation).
   This puts the go binary in `~/go/bin/ollama-copilot`
 * Then, change the settings for lsp-copilot and add `"proxy": "127.0.0.1:11435"`(
   this is the default local port).
 * Now, you also need to address the certificate situation. I use mkcert which you
   can install with homebrew using
 * `brew install mkcert`
 * Follow the instructions to install its root cert. We need a certificate that 
   covers ~two~ **Edit: **three hosts, so run
 * `cd ~/go/bin/`; m`kcert api.github.com copilot-proxy.githubusercontent.com proxy.
   individual.githubcopilot.com`
 * which gives you two files with which you can now now start the proxy:
 * `~/go/bin/ollama-copilot -cert ~/go/bin/api.github.com+2.pem -key ~/go/bin/api.
   github.com+2-key.pem`
 * Finally, you need to add one more thing to the lsp-copilot config JSON. First
   find out the location of the root cert: `echo $(mkcert -CAROOT)/rootCA.pem` and
   add an env section there ([see this FAQ](https://github.com/TerminalFi/LSP-copilot#i-see-unable_to_get_issuer_cert_locally-error)),
   for me it’s:
 *     ```wp-block-code
       "env": {
       	"NODE_EXTRA_CA_CERTS": "~/Library/Application Support/mkcert/rootCA.pem"
       },
       ```
   
 * This made it work for me. **Edit:** It seems a bit erratic. For me it works most
   reliably if you start ollama-copilot first, and only then Sublime Text. You can
   see the proxy at work through its output in the terminal.
 *     ```wp-block-code
       2024/11/15 16:04:08 request: POST /v1/engines/copilot-codex/completions
       2024/11/15 16:04:12 response: POST /v1/engines/copilot-codex/completions 200 4.744932083s
       ```
   
 * And this is from the LSP log panel:
 *     ```wp-block-code
       :: [16:04:07.967]  -> LSP-copilot textDocument/didChange: {'textDocument': {'uri': 'file:///...', 'version': 42}, 'contentChanges': [{'range': {'start': {'line': 2860, 'character': 53}, 'end': {'line': 2860, 'character': 53}}, 'rangeLength': 0, 'text': 'c'}]}
       :: [16:04:08.013] --> LSP-copilot getCompletions (6): <params with 147614 characters>
       :: [16:04:08.027] --> LSP-copilot getCompletionsCycling (7): <params with 147614 characters>
       :: [16:04:08.133] <-  LSP-copilot statusNotification: {'status': 'InProgress', 'message': ''}
       :: [16:04:08.156] <-  LSP-copilot statusNotification: {'status': 'InProgress', 'message': ''}
       :: [16:04:12.447] <-  LSP-copilot window/logMessage: {'type': 3, 'message': '[fetchCompletions] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 4288 ms'}
       :: [16:04:12.920] <-  LSP-copilot window/logMessage: {'type': 3, 'message': '[streamChoices] solution 0 returned. finish reason: [Iteration Done]'}
       :: [16:04:12.920] <-  LSP-copilot window/logMessage: {'type': 3, 'message': '[streamChoices] request done: headerRequestId: [] model deployment ID: []'}
       :: [16:04:12.920] <-  LSP-copilot statusNotification: {'status': 'Normal', 'message': ''}
       :: [16:04:12.920] <<< LSP-copilot (7) (duration: 4892ms): {'completions': [{'uuid': '4224f736-39f9-402e-b80e-027700892012', 'text': '\t\t\t\t\'title\'  => \'<span class="ab-icon dashicons dashicons-groups"></span>...', {'line': 2860, 'character': 54}, 'docVersion': 42, 'point': 105676, 'region': (105622, 105676)}]}
       ```
   
 * 
   ### Verdict
   
 * So far it showed that it is neither better nor faster than Github Copilot: In
   the logfile above you can see that a completion took almost 5 seconds. But ollama-
   copilot works offline which is better than no copilot. And it works with only
   a few moving parts.
 * [AI](https://alex.kirk.at/category/ai/), [Code](https://alex.kirk.at/category/code/),
   [Workflow](https://alex.kirk.at/category/workflow/)

 [Previous Page](https://alex.kirk.at/page/7/?output_format=md&term_id=44043) [Next Page](https://alex.kirk.at/page/9/?output_format=md&term_id=44043)