Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
gh release create "$tag" \
--title="$tag" \
--draft \
main.js manifest.json styles.css
dist/main.js dist/manifest.json dist/styles.css dist/obsidian-github-copilot.zip
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ node_modules
# They should be uploaded to GitHub releases instead.
main.js

# Build output
dist/

# Exclude sourcemaps
*.map

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ Use **GitHub Copilot** in the Obsidian editor. This plugin is a bridge between t
- A GitHub Copilot subscription (https://copilot.github.com/)
- Network connection to send and receive data from the GitHub Copilot service

## 📦 Download

You can download the latest release as a single zip file containing all plugin files (`main.js`, `manifest.json`, `styles.css`):

[![Download Latest Release](https://img.shields.io/github/v/release/TaiLaiCai/obsidian-github-copilot?label=Download%20Latest%20Release&style=for-the-badge)](https://github.com/TaiLaiCai/obsidian-github-copilot/releases/latest/download/obsidian-github-copilot.zip)

Or download individual files from the [latest release page](https://github.com/TaiLaiCai/obsidian-github-copilot/releases/latest):

| File | Download Link |
|------|---------------|
| `main.js` | [Download](https://github.com/TaiLaiCai/obsidian-github-copilot/releases/latest/download/main.js) |
| `manifest.json` | [Download](https://github.com/TaiLaiCai/obsidian-github-copilot/releases/latest/download/manifest.json) |
| `styles.css` | [Download](https://github.com/TaiLaiCai/obsidian-github-copilot/releases/latest/download/styles.css) |

## ⚙️ Installation

1. Install the plugin via the Obsidian community plugins browser.
Expand Down
26 changes: 25 additions & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import { copyFileSync, mkdirSync } from "fs";
import { resolve, dirname } from "path";
import { fileURLToPath } from "url";
import AdmZip from "adm-zip";

const __dirname = dirname(fileURLToPath(import.meta.url));

const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
Expand All @@ -9,6 +15,7 @@ if you want to view the source, please visit the github repository of this plugi
`;

const prod = process.argv[2] === "production";
const outdir = prod ? "dist" : ".";

const context = await esbuild.context({
banner: {
Expand Down Expand Up @@ -37,7 +44,7 @@ const context = await esbuild.context({
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
outfile: `${outdir}/main.js`,
loader: {
".tiktoken": "text",
".noindex": "text",
Expand All @@ -47,7 +54,24 @@ const context = await esbuild.context({
});

if (prod) {
mkdirSync(resolve(__dirname, "dist"), { recursive: true });
await context.rebuild();
copyFileSync(
resolve(__dirname, "manifest.json"),
resolve(__dirname, "dist/manifest.json"),
);
copyFileSync(
resolve(__dirname, "styles.css"),
resolve(__dirname, "dist/styles.css"),
);
const zip = new AdmZip();
zip.addLocalFile(resolve(__dirname, "dist/main.js"));
zip.addLocalFile(resolve(__dirname, "dist/manifest.json"));
zip.addLocalFile(resolve(__dirname, "dist/styles.css"));
zip.writeZip(resolve(__dirname, "dist/obsidian-github-copilot.zip"));
console.log(
"Packaged: dist/main.js, dist/manifest.json, dist/styles.css, dist/obsidian-github-copilot.zip",
);
process.exit(0);
} else {
await context.watch();
Expand Down
2 changes: 2 additions & 0 deletions src/copilot-chat/store/slices/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const defaultModels: ModelOption[] = [
{ label: "Claude Haiku 4.5", value: "claude-haiku-4.5" },
{ label: "Claude Sonnet 4", value: "claude-sonnet-4" },
{ label: "Claude Sonnet 4.5", value: "claude-sonnet-4.5" },
{ label: "Claude Opus 4.6", value: "claude-opus-4.6" },
{ label: "Claude Sonnet 4.6", value: "claude-sonnet-4.6" },
{ label: "Gemini 2.5 Pro", value: "gemini-2.5-pro" },
{ label: "Gemini 3 Pro", value: "gemini-3-pro-preview" },
{ label: "Gemini 3 Flash", value: "gemini-3-flash-preview" },
Expand Down