feat(cmd): AvanteClear (#518)

Remove all cache/history path.

Co-authored-by: Aaron Pham <Aaronpham0103@gmail.com>
This commit is contained in:
GNITOAHC 2024-09-04 19:38:59 +08:00 committed by GitHub
parent e55f9f753f
commit a4a037cec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,7 @@ H.commands = function()
return vim.tbl_filter(function(key) return key:find(prefix, 1, true) == 1 end, Config.providers) return vim.tbl_filter(function(key) return key:find(prefix, 1, true) == 1 end, Config.providers)
end, end,
}) })
cmd("Clear", function() require("avante.path").clear() end, { desc = "avante: clear all chat history" })
end end
H.keymaps = function() H.keymaps = function()

View File

@ -143,6 +143,9 @@ end
P.available = function() return templates ~= nil end P.available = function() return templates ~= nil end
P.clear = function() P.cache_path:rm({ recursive = true }) end P.clear = function()
P.cache_path:rm({ recursive = true })
P.history_path:rm({ recursive = true })
end
return P return P